I have an ActionController::TestCase that's failing and I don't know why.
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
setup do
@user = users(:bob)
sign_in @user
end
test "should create user" do
assert_difference('User.count') do
post :create, user: {
first_name: 'Alice',
email: 'alice@example.com',
password: 'adflihbrgshbart'
}
end
end
end
The result is
Failure:
UsersControllerTest#test_should_create_user [.../dev/test/controllers/users_controller_test.rb:23]
Minitest::Assertion: "User.count" didn't change by 1.
Expected: 5
Actual: 4
Is there a way to have post show me what the errors? For instance, is there a way I can access errors
array to call errors.full_messages
that'd normally be available in the resulting view when there's an error?