Skip to content

Commit

Permalink
Fix specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio-e committed Sep 24, 2024
1 parent 9d83940 commit 7d59490
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 2 additions & 0 deletions app/views/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
:password, required: true,
data: { test_id: "password_field" },
pattern: ".{8,}",
title:"8 characters minimum",
placeholder: "Enter your password"
) %>
<p class="pt-1 text-xs text-white">Password should contain at least 8 characters</p>
Expand All @@ -36,6 +37,7 @@
:password_confirmation, required: true,
data: { test_id: "password_confirmation_field" },
pattern: ".{8,}",
title:"8 characters minimum",
placeholder: "Confirm password"
) %>
<%= form.error_message :password_confirmation %>
Expand Down
15 changes: 2 additions & 13 deletions spec/system/user_sign_up_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
context "when the password & password confirmation doesn't match up" do
it "does not create a new user" do
find_dti("email_field").set("[email protected]")
find_dti("password_field").set("hello")
find_dti("password_confirmation_field").set("world")
find_dti("password_field").set("hellohello")
find_dti("password_confirmation_field").set("worldworld")
find_dti("sign_up_button").click

expect(page).to have_content("Password confirmation doesn't match Password")
Expand All @@ -27,17 +27,6 @@
end
end

context "when the password doesn't met the length criteria" do
it "does not create a new user" do
find_dti("email_field").set("[email protected]")
find_dti("password_field").set("foobar")
find_dti("password_confirmation_field").set("foobar")
find_dti("sign_up_button").click

expect(page).to have_content("Password is too short (minimum is 8 characters)")
end
end

context "when the user inputs valid credentials" do
it "creates a new user" do
find_dti("email_field").set("[email protected]")
Expand Down

0 comments on commit 7d59490

Please sign in to comment.