Class: MuckEngine::Controllers::Matchers::RequireLoginMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/muck-engine/test/controllers/matchers/login_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(action, verb, login_url, context) ⇒ RequireLoginMatcher

Returns a new instance of RequireLoginMatcher.



19
20
21
22
23
24
# File 'lib/muck-engine/test/controllers/matchers/login_matcher.rb', line 19

def initialize(action, verb, , context)
  @action = action
  @verb = verb
  @login_url = 
  @context = context
end

Instance Method Details

#descriptionObject



35
36
37
# File 'lib/muck-engine/test/controllers/matchers/login_matcher.rb', line 35

def description
  "require login #{@action}"
end

#failure_messageObject



31
32
33
# File 'lib/muck-engine/test/controllers/matchers/login_matcher.rb', line 31

def failure_message
  "Expected a #{@action} to #{@action} to require login"
end

#matches?(controller) ⇒ Boolean

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/muck-engine/test/controllers/matchers/login_matcher.rb', line 26

def matches?(controller)
  @controller = controller
  requires_login?
end