Add missing title attribute to user profile page (#1349)

* Add missing title attribute

* Add spec

* Fix test
This commit is contained in:
Ben Halpern 2018-12-17 15:04:00 -05:00 committed by GitHub
parent 430b80d3c3
commit 28736cda20
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 1 deletions

View file

@ -4,7 +4,7 @@
<meta property="og:type" content="website" />
<meta property="og:url" content="https://dev.to/<%= @user.username %>" />
<meta property="og:title" content="<%= @user.name %> — - DEV Profile" />
<meta property="og:title" content="<%= @user.name %> — DEV Profile" />
<meta property="og:image" content="<%= GeneratedImage.new(@user).social_image %>" >
<meta property="og:description" content="<%= @user.summary %>" />
<meta property="og:site_name" content="The DEV Community" />

View file

@ -1,3 +1,5 @@
<% title @user.name %>
<%= content_for :page_meta do %>
<%= render "users/meta" %>
<% end %>

View file

@ -16,6 +16,10 @@ describe "User index", type: :feature do
end
end
it "shows proper title tag" do
expect(page).to have_title("#{user.name} - DEV Community 👩‍💻👨‍💻")
end
it "shows user's articles" do
within(".single-article") do
expect(page).to have_content(article.title)