Skip to content

Commit fa8da1c

Browse files
Add coverage for volunteers setting their passwords
1 parent 9deee4c commit fa8da1c

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-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/invitation/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

0 commit comments

Comments
 (0)