Add username to profile more info button (#11451)

* Add username to profile more info button

* Update spec/requests/user/user_profile_spec.rb

Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>

Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
This commit is contained in:
Ben Halpern 2020-11-17 10:07:47 -05:00 committed by GitHub
parent f3a69bbd84
commit f5670e6fa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View file

@ -150,7 +150,7 @@
<%= render "users/metadata" %>
<div class="p-3 pt-0 block m:hidden js-user-info-trigger-wrapper">
<button type="button" class="crayons-btn crayons-btn--outlined w-100 js-user-info-trigger">More info about user...</button>
<button type="button" class="crayons-btn crayons-btn--outlined w-100 js-user-info-trigger">More info about @<%= @user.username %></button>
</div>
<div class="crayons-modal align-left hidden">

View file

@ -133,6 +133,9 @@ infinitely branching threads.
The user is the authorization/identity component of logging into the app. It is
also the public profile/authorship/etc. belonging to the people who use the app.
While "user" is a perfectly good technical name, it is a fairly cold way to refer
to humans, so we should prefer labeling people as members, or by their name/username.
## Tags
Tags are used to organize user generated content. Each tag has a set of rules

View file

@ -19,6 +19,11 @@ RSpec.describe "UserProfiles", type: :request do
expect(response.body).to include "Pinned"
end
it "calls user by their username in the 'more info' area" do
get "/#{user.username}"
expect(response.body).to include "More info about @#{user.username}"
end
it "does not render pins if they don't exist" do
get "/#{user.username}"
expect(response.body).not_to include "Pinned"