Add tag list component to debate feed
This commit is contained in:
@@ -2785,7 +2785,8 @@ table {
|
||||
}
|
||||
}
|
||||
|
||||
p {
|
||||
p,
|
||||
.sdg-tag-list {
|
||||
padding: 0 $line-height / 4;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.sdg-tag-list {
|
||||
margin-top: $line-height / 2;
|
||||
}
|
||||
|
||||
.feed-debates,
|
||||
.feed-proposals {
|
||||
@include grid-col;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<div class="debate">
|
||||
<strong><%= link_to debate.title, url_for(debate) %></strong>
|
||||
<%= render SDG::TagListComponent.new(debate, limit: 5) %>
|
||||
</div>
|
||||
|
||||
25
spec/components/widget/feeds/debate_component_spec.rb
Normal file
25
spec/components/widget/feeds/debate_component_spec.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
require "rails_helper"
|
||||
|
||||
describe Widget::Feeds::DebateComponent, type: :component do
|
||||
let(:debate) { create(:debate, sdg_goals: [SDG::Goal[1]]) }
|
||||
let(:component) { Widget::Feeds::DebateComponent.new(debate) }
|
||||
|
||||
before do
|
||||
Setting["feature.sdg"] = true
|
||||
Setting["sdg.process.debates"] = true
|
||||
end
|
||||
|
||||
it "renders a title with link" do
|
||||
render_inline component
|
||||
|
||||
expect(page).to have_link debate.title, href: "/debates/#{debate.to_param}"
|
||||
end
|
||||
|
||||
it "renders a tag list" do
|
||||
render_inline component
|
||||
|
||||
expect(page).to have_link "1. No Poverty",
|
||||
title: "See all Debates related to goal 1",
|
||||
href: "/debates?advanced_search#{CGI.escape("[goal]")}=1"
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user