Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/lib/gitlab/external_authorization/response_spec.rb')
-rw-r--r--spec/lib/gitlab/external_authorization/response_spec.rb20
1 files changed, 10 insertions, 10 deletions
diff --git a/spec/lib/gitlab/external_authorization/response_spec.rb b/spec/lib/gitlab/external_authorization/response_spec.rb
index 11f83feb76f..716196e0aa2 100644
--- a/spec/lib/gitlab/external_authorization/response_spec.rb
+++ b/spec/lib/gitlab/external_authorization/response_spec.rb
@@ -3,21 +3,21 @@
require 'spec_helper'
RSpec.describe Gitlab::ExternalAuthorization::Response do
- let(:excon_response) { double }
+ let(:http_response) { double }
- subject(:response) { described_class.new(excon_response) }
+ subject(:response) { described_class.new(http_response) }
describe '#valid?' do
it 'is valid for 200, 401, and 403 responses' do
- [200, 401, 403].each do |status|
- allow(excon_response).to receive(:status).and_return(status)
+ [200, 401, 403].each do |code|
+ allow(http_response).to receive(:code).and_return(code)
expect(response).to be_valid
end
end
it "is invalid for other statuses" do
- expect(excon_response).to receive(:status).and_return(500)
+ expect(http_response).to receive(:code).and_return(500)
expect(response).not_to be_valid
end
@@ -25,13 +25,13 @@ RSpec.describe Gitlab::ExternalAuthorization::Response do
describe '#reason' do
it 'returns a reason if it was included in the response body' do
- expect(excon_response).to receive(:body).and_return({ reason: 'Not authorized' }.to_json)
+ expect(http_response).to receive(:body).and_return({ reason: 'Not authorized' }.to_json)
expect(response.reason).to eq('Not authorized')
end
it 'returns nil when there was no body' do
- expect(excon_response).to receive(:body).and_return('')
+ expect(http_response).to receive(:body).and_return('')
expect(response.reason).to eq(nil)
end
@@ -39,14 +39,14 @@ RSpec.describe Gitlab::ExternalAuthorization::Response do
describe '#successful?' do
it 'is `true` if the status is 200' do
- allow(excon_response).to receive(:status).and_return(200)
+ allow(http_response).to receive(:code).and_return(200)
expect(response).to be_successful
end
it 'is `false` if the status is 401 or 403' do
- [401, 403].each do |status|
- allow(excon_response).to receive(:status).and_return(status)
+ [401, 403].each do |code|
+ allow(http_response).to receive(:code).and_return(code)
expect(response).not_to be_successful
end