Add tag list component to process feed

Remember that this component (widget/feeds/process) is displayed both in
the home page and in the target index.
This commit is contained in:
taitus
2021-01-30 18:33:36 +01:00
parent ca36dd56f0
commit 35db41827c
3 changed files with 26 additions and 2 deletions

View File

@@ -0,0 +1,23 @@
require "rails_helper"
describe Widget::Feeds::ProcessComponent, type: :component do
let(:process) { create(:legislation_process, sdg_goals: [SDG::Goal[1]]) }
let(:component) { Widget::Feeds::ProcessComponent.new(process) }
before do
Setting["feature.sdg"] = true
Setting["sdg.process.legislation"] = true
end
it "renders a card with link" do
render_inline component
expect(page).to have_link href: "/legislation/processes/#{process.to_param}"
end
it "renders a plain tag list" do
render_inline component
expect(page).to have_css("img[alt='1. No Poverty']")
end
end