Skip to content

Commit b1ae0a7

Browse files
authored
Merge pull request #6646 from rubyforgood/6637-display-user-email-on-profile-page
Display the user's email on their profile page
2 parents dc6ac28 + fd0fa5c commit b1ae0a7

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

app/views/users/_edit_profile.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
<strong class="text-dark">Added to system </strong>
77
<%= resource&.decorate(context: {format: :edit_profile})&.formatted_created_at %>
88
</div>
9+
<div class="mb-1">
10+
<strong class="text-dark">Email</strong>
11+
<%= resource&.email %>
12+
</div>
913
<div class="mb-1">
1014
<strong class="text-dark">Invitation email sent </strong>
1115
<%= resource&.decorate(context: {format: :edit_profile})&.formatted_invitation_sent_at || "never" %>

spec/requests/users_spec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@
99
describe "GET /edit" do
1010
context "with a volunteer signed in" do
1111
it "renders a successful response" do
12-
sign_in create(:volunteer)
12+
volunteer = create(:volunteer)
13+
sign_in volunteer
1314

1415
get edit_users_path
1516

1617
expect(response).to be_successful
18+
expect(response.body).to include(volunteer.email)
1719
end
1820
end
1921

2022
context "with an admin signed in" do
2123
it "renders a successful response" do
22-
sign_in build(:casa_admin)
24+
admin = build(:casa_admin)
25+
sign_in admin
2326

2427
get edit_users_path
2528

2629
expect(response).to be_successful
30+
expect(response.body).to include(admin.email)
2731
end
2832
end
2933
end

0 commit comments

Comments
 (0)