aboutsummaryrefslogtreecommitdiffstats
path: root/spec/support/shared_context.rb
blob: c08ee61630e944477a40a8b3d2b63a265891cf39 (plain)
1
2
3
4
5
6
7
8
shared_context 'iboo authenticated api user' do
  let(:api_key) { create(:api_key) }
  let(:user)    { create(:user, organisation: api_key.organisation ) }

  before do
    request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user.username, api_key.token)
  end
end