Add missing class back in for signed out featured post on feed (#13445)

* Add missing class back in

* Fix tests
This commit is contained in:
Andy Zhao 2021-04-19 11:00:50 -04:00 committed by GitHub
parent 887c490db7
commit d5a55c0a3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -5,7 +5,8 @@
<% end %>
<% if featured == true || (feed_style_preference == "rich" && story.main_image.present?) %>
<a href="<%= story.path %>" title="<%= story.title %>" aria-label="article"
style="background-color: <%= story.main_image_background_hex_color %>; background-image: url(<%= cloud_cover_url(story.main_image) %>);" class="crayons-story__cover__image">
style="background-color: <%= story.main_image_background_hex_color %>; background-image: url(<%= cloud_cover_url(story.main_image) %>);"
class="crayons-story__cover crayons-story__cover__image">
<span class="hidden"><%= story.title %></span>
</a>
<% end %>

View file

@ -150,7 +150,7 @@ RSpec.describe "StoriesIndex", type: :request do
allow(SiteConfig).to receive(:feed_style).and_return("basic")
get "/"
expect(response.body.scan(/(?=class="crayons-story__cover__image)/).count).to be 1
expect(response.body.scan(/(?=class="crayons-story__cover crayons-story__cover__image)/).count).to be 1
end
it "shows multiple cover images if rich feed style" do
@ -158,7 +158,7 @@ RSpec.describe "StoriesIndex", type: :request do
allow(SiteConfig).to receive(:feed_style).and_return("rich")
get "/"
expect(response.body.scan(/(?=class="crayons-story__cover__image)/).count).to be > 1
expect(response.body.scan(/(?=class="crayons-story__cover crayons-story__cover__image)/).count).to be > 1
end
context "with campaign hero" do