Fixed hiding 'Click to edit' link for drafts (#17051)
* Fixed hiding 'Click to edit' link for drafts * Improve "click to edit" link spec Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> * Make the expectation more clear Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com> Co-authored-by: Julianna Tetreault <32834804+juliannatetreault@users.noreply.github.com>
This commit is contained in:
parent
33195929aa
commit
b14e5522cd
2 changed files with 5 additions and 5 deletions
|
|
@ -69,7 +69,7 @@
|
|||
<div class="crayons-notice crayons-notice--danger mb-4" aria-live="polite">
|
||||
<strong><%= t("views.articles.unpublished.subtitle") %></strong><%= t("views.articles.unpublished.text") %>
|
||||
<% if user_signed_in? %>
|
||||
<a id="author-click-to-edit" href="<%= @article.path %>/edit" class="fw-bold" display="none"><%= t("views.articles.unpublished.edit") %></a>
|
||||
<a id="author-click-to-edit" href="<%= @article.path %>/edit" class="fw-bold" style="display: none;"><%= t("views.articles.unpublished.edit") %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
|
|
@ -158,9 +158,9 @@ RSpec.describe "Views an article", type: :system do
|
|||
let(:query_params) { "?preview=#{article.password}" }
|
||||
let(:article_user) { create(:user) }
|
||||
|
||||
it "does not the article edit link" do
|
||||
it "renders the article edit link" do
|
||||
visit article_path
|
||||
expect(page.body).not_to include('display: inline-block;">Click to edit</a>')
|
||||
expect(page.body).to include('display: none;">Click to edit</a>')
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -168,10 +168,10 @@ RSpec.describe "Views an article", type: :system do
|
|||
let(:query_params) { "?preview=#{article.password}" }
|
||||
let(:article_user) { user }
|
||||
|
||||
it "does not the article edit link" do
|
||||
it "does not render the article edit link" do
|
||||
sign_out user
|
||||
visit article_path
|
||||
expect(page.body).not_to include('display: inline-block;">Click to edit</a>')
|
||||
expect(page.body).not_to include("Click to edit")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue