Skip to content

Instantly share code, notes, and snippets.

@captproton
Created November 7, 2009 00:03
Show Gist options
  • Select an option

  • Save captproton/228402 to your computer and use it in GitHub Desktop.

Select an option

Save captproton/228402 to your computer and use it in GitHub Desktop.
shoulda test:
test "should destroy shop" do
assert_difference('Shop.count', -1) do
delete :destroy, :id => shops(:one).to_param
end
assert_redirected_to shops_path
end
Shoulda error:
1) Error:
test_should_destroy_shop(ShopsControllerTest):
NoMethodError: undefined method `shops' for #<ShopsControllerTest:0x236cdf4>
/test/functional/shops_controller_test.rb:40:in `test_should_destroy_shop'
/test/functional/shops_controller_test.rb:39:in `test_should_destroy_shop'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment