Skip to content

Commit ee987fe

Browse files
stefannibrasilcompwron
authored andcommitted
Change password form title
Fixes #6768 Add view tests for users setting their passwords and sending an invite.
1 parent 6871686 commit ee987fe

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

app/views/devise/invitations/edit.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="password-box px-4 pb-3">
2-
<h2 class="my-3">Send invitation</h2>
2+
<h2 class="my-3">Set password</h2>
33

44
<%= form_with(model: resource, as: resource_name, url: invitation_path(resource_name), local: true, html: {method: :put}) do |f| %>
55
<%= render "/shared/error_messages", resource: resource %>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
require "rails_helper"
2+
3+
RSpec.describe "users/invitations/edit", type: :view do
4+
it "displays title" do
5+
render template: "devise/invitations/edit"
6+
expect(rendered).to have_text("Set password")
7+
end
8+
9+
it "displays fields for user to set password" do
10+
render template: "devise/invitations/edit"
11+
expect(rendered).to have_field("user_invitation_token", type: :hidden)
12+
expect(rendered).to have_text("Password")
13+
expect(rendered).to have_field("user_password")
14+
expect(rendered).to have_text("Password confirmation")
15+
expect(rendered).to have_field("user_password_confirmation")
16+
expect(rendered).to have_button("Set my password")
17+
end
18+
end
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
require "rails_helper"
2+
3+
RSpec.describe "users/invitations/new", type: :view do
4+
it "displays title" do
5+
render template: "devise/invitations/new"
6+
expect(rendered).to have_text("Send invitation")
7+
end
8+
9+
it "displays fields for inviting a user" do
10+
render template: "devise/invitations/new"
11+
expect(rendered).to have_text("Email")
12+
expect(rendered).to have_field("user_email")
13+
expect(rendered).to have_button("Send an invitation")
14+
end
15+
end

0 commit comments

Comments
 (0)