Permalink
Browse files

add tests to ensure correct id_res/setup_needed responses are generat…

…ed on successful/failed immediate requests respectively.
  • Loading branch information...
tquackenbush committed Feb 25, 2011
1 parent f8217fa commit 12e3240ecf1bfca47a38a960a89acd6ca9174044
Showing with 19 additions and 4 deletions.
  1. +19 −4 spec/server_app_spec.rb
View
@@ -37,10 +37,25 @@
describe "and is immediate" do
- it "should return an openid.mode equal to setup_needed" do
- response = checkid_immediate(@request)
- params = openid_params(response)
- params['openid.mode'].should == 'setup_needed'
+ describe "with a success flag" do
+
+ it "should return an openid.mode equal to id_res" do
+ response = checkid_setup(@request, 'openid.success' => 'true')
+ params = openid_params(response)
+ params['openid.mode'].should == 'id_res'
+ end
+
+ end
+
+ describe "without a success flag" do
+
+ it "should return an openid.mode equal to setup_needed" do
+ response = checkid_immediate(@request)
+ params = openid_params(response)
+ params['openid.mode'].should == 'setup_needed'
+ params['user_setup_url'].should == ''
+ end
+
end
end

0 comments on commit 12e3240

Please sign in to comment.