Skip to content

Commit

Permalink
spec for request_phase
Browse files Browse the repository at this point in the history
  • Loading branch information
nov committed Jul 19, 2023
1 parent 4271b35 commit 4c77710
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/omniauth/strategies/oauth2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ def app
end
end

describe "#request_phase" do
subject(:instance) { fresh_strategy.new(app, :client_options => {"authorize_url" => "https://example.com/authorize"}) }

before do
allow(instance).to receive(:request) do
double("Request", :scheme => 'https', :url => 'https://rp.example.com', :env => {}, :query_string => {})
end
end

it do
response = instance.request_phase
expect(response[0]).to be 302
expect(response[1]['location']).to be_start_with "https://example.com/authorize"
end
end

describe "#authorize_params" do
subject { fresh_strategy }

Expand Down

0 comments on commit 4c77710

Please sign in to comment.