Fix styles for poll dates

We accidentally introduced a typo in commit f497227e3 which caused the
dates to be rendered outside the element where the dates styles are
applied.
This commit is contained in:
Javi Martín
2024-04-22 04:04:22 +02:00
parent 08ca920819
commit 7b3b41386e
2 changed files with 10 additions and 3 deletions

View File

@@ -27,13 +27,12 @@
</div>
</div>
<div class="small-12 medium-6 column" data-equalizer-watch>
<div class="dates"></div>
<% if poll.questions.one? %>
<h4><%= link_to_poll poll.questions.first.title, poll %></h4>
<%= dates %>
<div class="dates"><%= dates %></div>
<% else %>
<h4><%= link_to_poll poll.name, poll %></h4>
<%= dates %>
<div class="dates"><%= dates %></div>
<ul class="margin-top">
<% poll.questions.sort_for_list.each do |question| %>

View File

@@ -42,6 +42,14 @@ describe Polls::PollComponent do
end
end
it "renders the dates inside an HTML tag" do
poll = create(:poll, starts_at: "2015-07-15", ends_at: "2015-07-22")
render_inline Polls::PollComponent.new(poll)
expect(page).to have_css ".dates", exact_text: "From 2015-07-15 to 2015-07-22"
end
it "shows a link to poll stats if enabled" do
poll = create(:poll, :expired, name: "Poll with stats", stats_enabled: true)