Skip to content

Instantly share code, notes, and snippets.

@julesfern
Created October 29, 2008 01:40
Show Gist options
  • Save julesfern/20578 to your computer and use it in GitHub Desktop.
Save julesfern/20578 to your computer and use it in GitHub Desktop.
it "should redirect users to the login screen with the correct return_to if return_to is set" do
return_to_param = MerbAuthSliceFullfat[:return_to_param]
@controller = get("/sekkrit", :format=>"html", return_to_param=>"/returnedsdfsdf")
@controller.status.should == 302
@controller.should redirect_to(@controller.url(:merb_auth_slice_fullfat_login, return_to_param=>"/returned"))
end
raises:
Expected exceptions#unauthenticated to redirect to </auth/login?return_to=%2Freturned>, but it redirected to </auth/login?return_to=%2Freturnedsdfsdf>
while:
it "should redirect users to the login screen with the correct return_to if return_to is set" do
return_to_param = MerbAuthSliceFullfat[:return_to_param]
@controller = get("/sekkrit", :format=>"html", return_to_param=>"/returned")
@controller.status.should == 302
@controller.should redirect_to(@controller.url(:merb_auth_slice_fullfat_login, return_to_param=>"/returned"))
end
raises:
'Exceptions should redirect users to the login screen with the correct return_to if return_to is set' FAILED
Spec::Expectations::ExpectationNotMetError
./spec/controllers/exceptions_spec.rb:28:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment