Writing a test with the test helper for the following test will pass, while executing the code in the controller will actually raise an exception:
class FooController
def create
submit FooForm, Foo.new, params, extra_argument
end
end
class FooControllerTest
def test_should_create
assert_submits OrderForm, stub: order_double do
post foos_url
end
end
end
The stub that replaces the submit method verifies that the first argument is the correct form, but not that the second and third arguments are present (and no more than that).
Writing a test with the test helper for the following test will pass, while executing the code in the controller will actually raise an exception:
The stub that replaces the submit method verifies that the first argument is the correct form, but not that the second and third arguments are present (and no more than that).