Reputation: 175
A test gaves me that error on this method,
def test_create
get :new
assert_template 'admin/supplier/new'
assert_difference(Supplier, :count) do
post :create, :supplier => {:name => 'Juan', :province => 'provincia'}
assert_response :redirect
assert_redirected_to :action => 'index'
end
assert_equal 'was succesfully created.', flash[:notice]
end
exactly the error is on
assert_difference(Supplier, :count) do
Upvotes: 1
Views: 195
Reputation:
You aren't using assert_difference
correctly. Try
assert_difference 'Supplier.count' do
More examples are in the docs
Upvotes: 3