summaryrefslogtreecommitdiff
path: root/spec/requests/cards_controller/index_spec.rb
blob: d88b28cd01184756e38a763fde8dbbc55efb1c63 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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