summaryrefslogtreecommitdiff
path: root/spec/requests/addresses_controller/index_spec.rb
blob: 63fc7761d9a7dcec7a8ccaf320d48f403950bee0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'GET /api/account/addresses', type: :request do
  let(:user) { create(:user_account, role: 'regular') }
  let(:token) { jwt(user) }

  before(:each) do
    create_list(:address, 5)
    relate_user_and_addresses(user, Address.all)
  end

  it_behaves_like 'a GET index request' do
    let(:headers) { { 'Authorization' => "Bearer #{token['token']}" } }
    let(:route) { '/api/account/addresses' }
    let(:pagination_size) { 5 }
  end
end