Skip to content

Commit

Permalink
AO3-6594 don't show location section if empty (#4620)
Browse files Browse the repository at this point in the history
* AO3-6594 don't show location section if empty

If the user's location is set to empty-string, omit the "I live in" section on their profile

* AO3-6594 Simplify presence detection with .present?
  • Loading branch information
eliahhecht authored Apr 4, 2024
1 parent 61142b1 commit e9030d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/profile/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<dd><%= l(@profile.created_at) %></dd>
<dt><%= ts("My user ID is:") %></dt>
<dd><%= @user.id %></dd>
<% if @profile.location %>
<% if @profile.location.present? %>
<dt class="location"><%=h ts("I live in:") %></dt>
<dd><%=h @profile.location %></dd>
<% end %>
Expand Down
3 changes: 3 additions & 0 deletions features/other_a/profile_edit.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,21 @@ Scenario: Add details
When I fill in the details of my profile
Then I should see "Your profile has been successfully updated"
And 0 emails should be delivered
And I should see "I live in"

Scenario: Change details

When I change the details in my profile
Then I should see "Your profile has been successfully updated"
And 0 emails should be delivered
And I should see "I live in"

Scenario: Remove details

When I remove details from my profile
Then I should see "Your profile has been successfully updated"
And 0 emails should be delivered
And I should not see "I live in"

Scenario: Change details as an admin

Expand Down

0 comments on commit e9030d0

Please sign in to comment.