Fix missing thumbs down image (#6151)

This commit is contained in:
Mac Siri 2020-03-05 12:30:26 -05:00 committed by GitHub
parent bbec492844
commit b0a873316f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View file

@ -11,7 +11,8 @@ class ReactionImage
"unicorn" => "emoji/emoji-one-unicorn.png",
"hands" => "emoji/emoji-one-hands.png",
"thinking" => "emoji/emoji-one-thinking.png",
"readinglist" => "emoji/emoji-one-bookmark.png"
"readinglist" => "emoji/emoji-one-bookmark.png",
"thumbsdown" => "emoji/emoji-one-thumbs-down.png"
}.freeze
images[category]
end

View file

@ -10,4 +10,10 @@ FactoryBot.define do
association :reactable, factory: :article
category { "readinglist" }
end
factory :thumbsdown_reaction, class: "Reaction" do
user
association :reactable, factory: :article
category { "thumbsdown" }
end
end

View file

@ -579,6 +579,18 @@ RSpec.describe "NotificationsIndex", type: :request do
end
end
context "when user is trusted" do
let(:user) { create(:user, :trusted) }
let(:reaction) { create(:thumbsdown_reaction, user: user) }
it "allow sees thumbsdown category" do
sign_in user
Notification.send_reaction_notification_without_delay(reaction, user)
get "/notifications"
expect(response.body).to include("Notifications")
end
end
context "when a user has a new welcome notification" do
# TODO: [@thepracticaldev/delightful] Only test against type_of Welcome once Onbarding notifications have been removed.
let(:active_broadcast) { create(:broadcast, :onboarding, :active) }