Skip to content

Commit

Permalink
Add one more spec
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Nov 15, 2016
1 parent 16bd81a commit 23ffea5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion spec/omniauth/strategies/oauth2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,26 @@ def app
expect(instance.callback_url).to eq("http://test/foo?bar=1")
end

it "does not include any query parameters like \"code\" and \"state\"" do
it "does not contain any parameters" do
instance = subject.new("abc", "def")
allow(instance).to receive(:full_host) do
"http://test"
end
allow(instance).to receive(:script_name) do
"/foo"
end
allow(instance).to receive(:callback_path) do
"/bar/callback"
end
allow(instance).to receive(:request) do
double("Request",
:params => {},
:query_string => "")
end
expect(instance.callback_url).to eq("http://test/foo/bar/callback")
end

it "does not include any query parameters when invoked from within a callback" do
instance = subject.new("abc", "def")
allow(instance).to receive(:full_host) do
"http://test"
Expand Down

0 comments on commit 23ffea5

Please sign in to comment.