Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@darron
Created November 2, 2009 21:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darron/224488 to your computer and use it in GitHub Desktop.
Save darron/224488 to your computer and use it in GitHub Desktop.
test 'create' do
Duck.any_instance.expects(:save).returns(true)
@duck = ducks(:basic)
post :create, :duck => @duck.attributes
assert_response :redirect
end
# is erroring out:
# 1) Error:
#test_create(DucksControllerTest):
#NoMethodError: undefined method `any_instance' for #<Class:0x102e730f8>
# /test/functional/ducks_controller_test.rb:6:in `test_create'
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment