Module: Remarkable::Controller::Matchers
- Included in:
- Macros, Spec::Rails::Example::ControllerExampleGroup
- Defined in:
- lib/remarkable/controller/macros/route_matcher.rb,
lib/remarkable/controller/macros/assign_matcher.rb,
lib/remarkable/controller/macros/set_session_matcher.rb,
lib/remarkable/controller/macros/respond_with_matcher.rb,
lib/remarkable/controller/macros/filter_params_matcher.rb,
lib/remarkable/controller/macros/set_the_flash_to_matcher.rb,
lib/remarkable/controller/macros/render_with_layout_matcher.rb,
lib/remarkable/controller/macros/respond_with_content_type_matcher.rb
Overview
Defined Under Namespace
Classes: AssignMatcher, FilterParams, RenderWithLayout, RespondWith, RespondWithContentType, Route, SetSessionMatcher, SetTheFlashTo
Instance Method Summary
collapse
Instance Method Details
#assign_to(*names) ⇒ Object
91
92
93
|
# File 'lib/remarkable/controller/macros/assign_matcher.rb', line 91
def assign_to(*names)
AssignMatcher.new(*names)
end
|
#filter_params(*keys) ⇒ Object
58
59
60
|
# File 'lib/remarkable/controller/macros/filter_params_matcher.rb', line 58
def filter_params(*keys)
FilterParams.new(*keys)
end
|
#render_with_layout(expected_layout = 'application') ⇒ Object
66
67
68
|
# File 'lib/remarkable/controller/macros/render_with_layout_matcher.rb', line 66
def render_with_layout(expected_layout = 'application')
RenderWithLayout.new(expected_layout)
end
|
#render_without_layout ⇒ Object
70
71
72
|
# File 'lib/remarkable/controller/macros/render_with_layout_matcher.rb', line 70
def render_without_layout
RenderWithLayout.new(nil)
end
|
#respond_with(type) ⇒ Object
57
58
59
|
# File 'lib/remarkable/controller/macros/respond_with_matcher.rb', line 57
def respond_with(type)
RespondWith.new(type)
end
|
#respond_with_content_type(content_type) ⇒ Object
55
56
57
|
# File 'lib/remarkable/controller/macros/respond_with_content_type_matcher.rb', line 55
def respond_with_content_type(content_type)
RespondWithContentType.new(content_type)
end
|
#return_from_session(*args, &block) ⇒ Object
63
64
65
66
|
# File 'lib/remarkable/controller/macros/set_session_matcher.rb', line 63
def return_from_session(*args, &block)
warn "[DEPRECATION] should_return_from_session is deprecated. Use should_set_session instead."
set_session(*args, &block)
end
|
#route(method, path, options) ⇒ Object
70
71
72
|
# File 'lib/remarkable/controller/macros/route_matcher.rb', line 70
def route(method, path, options)
Route.new(method, path, options)
end
|
#set_session(key, expected = nil, &block) ⇒ Object
59
60
61
|
# File 'lib/remarkable/controller/macros/set_session_matcher.rb', line 59
def set_session(key, expected=nil, &block)
SetSessionMatcher.new(key, expected, &block)
end
|
#set_the_flash_to(val = '') ⇒ Object
Also known as:
set_the_flash
54
55
56
|
# File 'lib/remarkable/controller/macros/set_the_flash_to_matcher.rb', line 54
def set_the_flash_to(val = '')
SetTheFlashTo.new(val)
end
|