warden 1.2.3 → 1.2.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +5 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +7 -0
  5. data/{History.rdoc → CHANGELOG.md} +16 -3
  6. data/Gemfile +3 -2
  7. data/Gemfile.lock +40 -0
  8. data/LICENSE +1 -1
  9. data/README.md +18 -0
  10. data/Rakefile +4 -8
  11. data/lib/warden/config.rb +3 -3
  12. data/lib/warden/errors.rb +2 -1
  13. data/lib/warden/hooks.rb +10 -9
  14. data/lib/warden/manager.rb +23 -10
  15. data/lib/warden/mixins/common.rb +2 -1
  16. data/lib/warden/proxy.rb +27 -11
  17. data/lib/warden/session_serializer.rb +1 -0
  18. data/lib/warden/strategies/base.rb +14 -8
  19. data/lib/warden/strategies.rb +1 -0
  20. data/lib/warden/test/helpers.rb +3 -2
  21. data/lib/warden/test/mock.rb +69 -0
  22. data/lib/warden/test/warden_helpers.rb +2 -1
  23. data/lib/warden/version.rb +2 -1
  24. data/lib/warden.rb +2 -0
  25. data/warden.gemspec +21 -18
  26. metadata +33 -50
  27. data/README.textile +0 -9
  28. data/spec/helpers/request_helper.rb +0 -51
  29. data/spec/helpers/strategies/failz.rb +0 -8
  30. data/spec/helpers/strategies/invalid.rb +0 -8
  31. data/spec/helpers/strategies/pass.rb +0 -8
  32. data/spec/helpers/strategies/pass_with_message.rb +0 -8
  33. data/spec/helpers/strategies/password.rb +0 -13
  34. data/spec/helpers/strategies/single.rb +0 -12
  35. data/spec/spec_helper.rb +0 -24
  36. data/spec/warden/authenticated_data_store_spec.rb +0 -114
  37. data/spec/warden/config_spec.rb +0 -48
  38. data/spec/warden/errors_spec.rb +0 -47
  39. data/spec/warden/hooks_spec.rb +0 -373
  40. data/spec/warden/manager_spec.rb +0 -316
  41. data/spec/warden/proxy_spec.rb +0 -1041
  42. data/spec/warden/scoped_session_serializer.rb +0 -123
  43. data/spec/warden/session_serializer_spec.rb +0 -53
  44. data/spec/warden/strategies/base_spec.rb +0 -313
  45. data/spec/warden/strategies_spec.rb +0 -93
  46. data/spec/warden/test/helpers_spec.rb +0 -93
  47. data/spec/warden/test/test_mode_spec.rb +0 -76
@@ -1,76 +0,0 @@
1
- # encoding: utf-8
2
- require 'spec_helper'
3
-
4
- describe Warden::Test::WardenHelpers do
5
- before :all do
6
- Warden.test_mode!
7
- end
8
-
9
- before do
10
- $captures = []
11
- @app = lambda{|e| valid_response }
12
- end
13
-
14
- after do
15
- Warden.test_reset!
16
- end
17
-
18
- it{ Warden.should respond_to(:test_mode!) }
19
- it{ Warden.should respond_to(:on_next_request) }
20
- it{ Warden.should respond_to(:test_reset!) }
21
-
22
- it "should execute the on_next_request block on the next request" do
23
- Warden.on_next_request do |warden|
24
- $captures << warden
25
- end
26
-
27
- setup_rack(@app).call(env_with_params)
28
- $captures.should have(1).item
29
- $captures.first.should be_an_instance_of(Warden::Proxy)
30
- end
31
-
32
- it "should execute many on_next_request blocks on the next request" do
33
- Warden.on_next_request{|w| $captures << :first }
34
- Warden.on_next_request{|w| $captures << :second }
35
- setup_rack(@app).call(env_with_params)
36
- $captures.should have(2).items
37
- $captures.should == [:first, :second]
38
- end
39
-
40
- it "should not execute on_next_request blocks on subsequent requests" do
41
- app = setup_rack(@app)
42
- Warden.on_next_request{|w| $captures << :first }
43
- app.call(env_with_params)
44
- $captures.should == [:first]
45
- $captures.clear
46
- app.call(env_with_params)
47
- $captures.should be_empty
48
- end
49
-
50
- it "should allow me to set new_on_next_request items to execute in the same test" do
51
- app = setup_rack(@app)
52
- Warden.on_next_request{|w| $captures << :first }
53
- app.call(env_with_params)
54
- $captures.should == [:first]
55
- Warden.on_next_request{|w| $captures << :second }
56
- app.call(env_with_params)
57
- $captures.should == [:first, :second]
58
- end
59
-
60
- it "should remove the on_next_request items when test is reset" do
61
- app = setup_rack(@app)
62
- Warden.on_next_request{|w| $captures << :first }
63
- Warden.test_reset!
64
- app.call(env_with_params)
65
- $captures.should == []
66
- end
67
-
68
- context "asset requests" do
69
- it "should not execute on_next_request blocks if this is an asset request" do
70
- app = setup_rack(@app)
71
- Warden.on_next_request{|w| $captures << :first }
72
- app.call(env_with_params("/assets/fun.gif"))
73
- $captures.should == []
74
- end
75
- end
76
- end