From 564203bace85c06d0de16ad5d6c2ac540642d84e Mon Sep 17 00:00:00 2001 From: HombreLaser Date: Thu, 30 Mar 2023 18:00:37 -0600 Subject: AƱade specs de CardsController MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spec/requests/cards_controller/index_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'spec/requests/cards_controller/index_spec.rb') diff --git a/spec/requests/cards_controller/index_spec.rb b/spec/requests/cards_controller/index_spec.rb index e69de29..d88b28c 100644 --- a/spec/requests/cards_controller/index_spec.rb +++ b/spec/requests/cards_controller/index_spec.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'GET /api/account/cards', type: :request do + let(:user) { create(:user_account, role: 'regular') } + let(:token) { jwt(user) } + + before(:each) do + create_list(:card, 3, user_account: user) + end + + it_behaves_like 'a GET index request' do + let(:headers) { { 'Authorization' => "Bearer #{token['token']}" } } + let(:route) { '/api/account/cards' } + let(:pagination_size) { 3 } + end +end -- cgit v1.2.3