lib/shoulda/controller/macros.rb in rmm5t-shoulda-2.0.5 vs lib/shoulda/controller/macros.rb in rmm5t-shoulda-2.0.6

- old
+ new

@@ -98,11 +98,11 @@ # Macro that creates a test asserting that the flash is empty. Same as # @should_set_the_flash_to nil@ 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 # # Example: # @@ -225,13 +225,13 @@ # Example: # # 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 else should "render without layout" do @@ -286,10 +286,10 @@ # should_route :post, "/posts", :action => :create # should_route :get, "/posts/1", :action => :show, :id => 1 # 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) unless options[:controller] options[:controller] = self.name.gsub(/ControllerTest$/, '').tableize