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:
23
spec/components/widget/feeds/process_component_spec.rb
Normal file
23
spec/components/widget/feeds/process_component_spec.rb
Normal 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
|
||||
Reference in New Issue
Block a user