Permalink
Browse files

Adding a few more tests

  • Loading branch information...
1 parent 44e4c57 commit bf68c117ca5de46029fee82d589cdf279ad1a612 Rodrigo Flores committed Feb 15, 2012
Showing with 19 additions and 1 deletion.
  1. +19 −1 spec/warden/proxy_spec.rb
View
@@ -365,7 +365,7 @@
end
setup_rack(app).call(@env)
end
-
+
it "should not run the callbacks when :run_callbacks is false" do
app = lambda do |env|
env['warden'].manager.should_not_receive(:_run_callbacks)
@@ -374,6 +374,24 @@
end
setup_rack(app).call(@env)
end
+
+ it "should run the callbacks when :run_callbacks is true" do
+ app = lambda do |env|
+ env['warden'].manager.should_receive(:_run_callbacks)
+ env['warden'].authenticate(:pass, :run_callbacks => true)
+ valid_response
+ end
+ setup_rack(app).call(@env)
+ end
+
+ it "should run the callbacks by default" do
+ app = lambda do |env|
+ env['warden'].manager.should_receive(:_run_callbacks)
+ env['warden'].authenticate(:pass)
+ valid_response
+ end
+ setup_rack(app).call(@env)
+ end
end
describe "get user" do

0 comments on commit bf68c11

Please sign in to comment.