sample_rails_tailwind/test/integration/users_signup_test.rb
songtianlun 712cd10894 style: standardize quotation marks and spacing
- Updated single quotes to double quotes for consistency
- Adjusted spacing in array definitions for better readability
- Ensured consistent use of quotes in flash messages and method parameters

These changes enhance the overall code style without altering any functionality.
2025-01-04 10:21:22 +08:00

31 lines
1.0 KiB
Ruby

require "test_helper"
class UsersSignupTest < ActionDispatch::IntegrationTest
test "invalid signup information" do
get signup_path
assert_no_difference "User.count" do
post users_path, params: { user: { name: "",
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 users_path, params: { user: { name: "Example User",
email: "user@example.com",
password: "password",
password_confirmation: "password" } }
end
follow_redirect!
assert_template "users/show"
assert_not flash.notice
assert is_logged_in?
end
end