Module: AuthenticatedTestHelper
- Defined in:
- lib/community_engine/authenticated_test_helper.rb
Instance Method Summary collapse
- #assert_http_authentication_required(login = nil) {|XmlLoginProxy.new(self, login)| ... } ⇒ Object
-
#assert_requires_login(login = nil) {|HttpLoginProxy.new(self, login)| ... } ⇒ Object
Assert the block redirects to the login.
- #reset!(*instance_vars) ⇒ Object
Instance Method Details
#assert_http_authentication_required(login = nil) {|XmlLoginProxy.new(self, login)| ... } ⇒ Object
11 12 13 |
# File 'lib/community_engine/authenticated_test_helper.rb', line 11 def assert_http_authentication_required(login = nil) yield XmlLoginProxy.new(self, login) end |
#assert_requires_login(login = nil) {|HttpLoginProxy.new(self, login)| ... } ⇒ Object
Assert the block redirects to the login
assert_requires_login(:bob) { |c| c.get :edit, :id => 1 }
7 8 9 |
# File 'lib/community_engine/authenticated_test_helper.rb', line 7 def assert_requires_login(login = nil) yield HttpLoginProxy.new(self, login) end |
#reset!(*instance_vars) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/community_engine/authenticated_test_helper.rb', line 15 def reset!(*instance_vars) instance_vars = [:controller, :request, :response] unless instance_vars.any? instance_vars.collect! { |v| "@#{v}".to_sym } instance_vars.each do |var| instance_variable_set(var, instance_variable_get(var).class.new) end end |