1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00
Files
wrestlingdev.com/test/integration/users_signup_test.rb

28 lines
928 B
Ruby

require "test_helper"
class UsersSignupTest < ActionDispatch::IntegrationTest
test "invalid signup information" do
get signup_path
assert_no_difference 'User.count' do
post signup_path, params: { user: { email: "user@invalid",
password: "foo",
password_confirmation: "bar" } }
end
assert_template 'users/new'
assert_select 'div.error_explanation'
assert_select 'div.alert-danger'
end
test "valid signup information" do
get signup_path
assert_difference 'User.count', 1 do
post signup_path, params: { user: { email: "user@example.com",
password: "password",
password_confirmation: "password" } }
end
follow_redirect!
assert_template 'static_pages/home'
assert session[:user_id].present?
end
end