mirror of
https://github.com/thoughtbot/shoulda-matchers.git
synced 2022-11-09 12:01:38 -05:00
Allow symbol parameter for should_render_with_layout [#99]
This commit is contained in:
parent
48a9202b93
commit
d06e020724
2 changed files with 5 additions and 4 deletions
|
@ -100,7 +100,7 @@ module ThoughtBot # :nodoc:
|
|||
def should_not_set_the_flash
|
||||
should_set_the_flash_to nil
|
||||
end
|
||||
|
||||
|
||||
# Macro that creates a test asserting that filter_parameter_logging
|
||||
# is set for the specified keys
|
||||
#
|
||||
|
@ -227,9 +227,9 @@ module ThoughtBot # :nodoc:
|
|||
# should_render_with_layout 'special'
|
||||
def should_render_with_layout(expected_layout = 'application')
|
||||
if expected_layout
|
||||
should "render with #{expected_layout} layout" do
|
||||
should "render with #{expected_layout.inspect} layout" do
|
||||
response_layout = @response.layout.blank? ? "" : @response.layout.split('/').last
|
||||
assert_equal expected_layout,
|
||||
assert_equal expected_layout.to_s,
|
||||
response_layout,
|
||||
"Expected to render with layout #{expected_layout} but was rendered with #{response_layout}"
|
||||
end
|
||||
|
@ -288,7 +288,7 @@ module ThoughtBot # :nodoc:
|
|||
# should_route :edit, "/posts/1", :action => :show, :id => 1
|
||||
# should_route :put, "/posts/1", :action => :update, :id => 1
|
||||
# should_route :delete, "/posts/1", :action => :destroy, :id => 1
|
||||
# should_route :get, "/users/1/posts/1",
|
||||
# should_route :get, "/users/1/posts/1",
|
||||
# :action => :show, :id => 1, :user_id => 1
|
||||
#
|
||||
def should_route(method, path, options)
|
||||
|
|
|
@ -93,6 +93,7 @@ class PostsControllerTest < Test::Unit::TestCase
|
|||
context "viewing a post on GET to #show" do
|
||||
setup { get :show, :user_id => users(:first), :id => posts(:first) }
|
||||
should_render_with_layout 'wide'
|
||||
should_render_with_layout :wide
|
||||
end
|
||||
|
||||
context "on GET to #new" do
|
||||
|
|
Loading…
Reference in a new issue