Module: AuthenticatedTestHelper

Defined in:
lib/community_engine/authenticated_test_helper.rb

Instance Method Summary collapse

Instance Method Details

#assert_http_authentication_required(login = nil) {|XmlLoginProxy.new(self, login)| ... } ⇒ Object

Yields:



11
12
13
# File 'lib/community_engine/authenticated_test_helper.rb', line 11

def assert_http_authentication_required( = nil)
  yield XmlLoginProxy.new(self, )
end

#assert_requires_login(login = nil) {|HttpLoginProxy.new(self, login)| ... } ⇒ Object

Assert the block redirects to the login

(:bob) { |c| c.get :edit, :id => 1 }

Yields:



7
8
9
# File 'lib/community_engine/authenticated_test_helper.rb', line 7

def ( = nil)
  yield HttpLoginProxy.new(self, )
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