gLgN4DsL
2017-01-12 03:14:05

require 'test_helper'

class UsersSignupTest < ActionDispatch::IntegrationTest

test "invalid signup information" do
get signup_path
assert_no_difference 'User.count' do
post users_path, user: { name: "",
email: "user@invalid",
password: "foo",
password_confirmation: "bar" }
end
assert_template 'users/new'
assert_select 'div#<CSS id for error explanation>'
assert_select 'div.<CSS class for field with error>' 
assertequal, @user.errors.count, 2
end
.

NoMethodError: NoMethodError: undefined method `errors' for nil:NilClass