Skip to content

Commit

Permalink
if we use a symbol, lets check what rails believes
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Sep 13, 2008
1 parent ab0e4cb commit 2075725
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/shoulda/controller/macros.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def should_respond_with(response)
# should_respond_with_content_type 'application/rss+xml'
def should_respond_with_content_type(content_type)
should "respond with content type of #{content_type}" do
if content_type.is_a? Symbol
content_type = Mime::EXTENSION_LOOKUP[content_type.to_s].to_s
end
assert_match content_type, @response.headers['type'], "Expected #{content_type} but was actually #{@response.headers['type']}"
end
end
Expand Down
1 change: 1 addition & 0 deletions test/functional/posts_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def setup
end
should_respond_with :success
should_respond_with_content_type 'application/rss+xml'
should_respond_with_content_type :rss
should_return_from_session :special, "'$2 off your next purchase'"
should_return_from_session :special_user_id, '@user.id'
should_assign_to :user, :posts
Expand Down

0 comments on commit 2075725

Please sign in to comment.