Permalink
Browse files

Fix failing test.

  • Loading branch information...
josevalim committed Jan 28, 2011
1 parent 283b29b commit b3d527dfa3878eae6d76ca43399ce504d6906962
Showing with 9 additions and 9 deletions.
  1. +9 −9 test/base_test.rb
View
@@ -30,14 +30,14 @@ def setup
protected
def mock_user(expectations={})
@mock_user ||= begin
user = mock(expectations.except(:errors))
user.stubs(:class).returns(User)
user.stubs(:errors).returns(expectations.fetch(:errors, {}))
user
end
def mock_user(expectations={})
@mock_user ||= begin
user = mock(expectations.except(:errors))
user.stubs(:class).returns(User)
user.stubs(:errors).returns(expectations.fetch(:errors, {}))
user
end
end
end
class IndexActionBaseTest < ActionController::TestCase
@@ -64,8 +64,8 @@ def test_controller_should_render_index
def test_render_all_users_as_xml_when_mime_type_is_xml
@request.accept = 'application/xml'
User.expects(:scoped).returns([mock_user])
mock_user.expects(:to_xml).returns('Generated XML')
User.expects(:scoped).returns(collection = [mock_user])
collection.expects(:to_xml).returns('Generated XML')
get :index
assert_response :success
assert_equal 'Generated XML', @response.body

0 comments on commit b3d527d

Please sign in to comment.