aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models
diff options
context:
space:
mode:
authorRobert2017-07-21 15:59:34 +0200
committerRobert2017-07-21 16:32:47 +0200
commitded817a7d0802cc2aafcdbe4bb256698f6868afd (patch)
tree30ac61f0f8483dc36d470da28a786eb091e5f0ff /spec/models
parent4fffff70d5dc57929653ed1d1a1ce68e9769cee4 (diff)
downloadchouette-core-ded817a7d0802cc2aafcdbe4bb256698f6868afd.tar.bz2
Refs: #3507@4.5h spec setup and refactoring, using Faraday in worker
- Setting up correct headers for the Webmock request (Oh Boy) - Refactoring all Faraday requests into `lib/af83/http_fetcher.rb` - Implementing the Download
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/organisation_spec.rb2
-rw-r--r--spec/models/user_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/spec/models/organisation_spec.rb b/spec/models/organisation_spec.rb
index 527f71015..1cce7e846 100644
--- a/spec/models/organisation_spec.rb
+++ b/spec/models/organisation_spec.rb
@@ -17,7 +17,7 @@ describe Organisation, :type => :model do
let(:conf) { Rails.application.config.stif_portail_api }
before :each do
stub_request(:get, "#{conf[:url]}/api/v1/organizations").
- with(headers: { 'Authorization' => "Token token=\"#{conf[:key]}\"" }).
+ with(stub_headers(authorization_token: conf[:key])).
to_return(body: File.open(File.join(Rails.root, 'spec', 'fixtures', 'organizations.json')), status: 200)
end
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb
index 6f98e5ce7..c21e7e6d0 100644
--- a/spec/models/user_spec.rb
+++ b/spec/models/user_spec.rb
@@ -69,7 +69,7 @@ describe User, :type => :model do
let(:conf) { Rails.application.config.stif_portail_api }
before :each do
stub_request(:get, "#{conf[:url]}/api/v1/users").
- with(headers: { 'Authorization' => "Token token=\"#{conf[:key]}\"" }).
+ with(stub_headers(authorization_token: conf[:key])).
to_return(body: File.open(File.join(Rails.root, 'spec', 'fixtures', 'users.json')), status: 200)
end