diff --git a/app/components/polls/poll_component.html.erb b/app/components/polls/poll_component.html.erb
index 9852c1b30..24594fc7e 100644
--- a/app/components/polls/poll_component.html.erb
+++ b/app/components/polls/poll_component.html.erb
@@ -27,13 +27,12 @@
-
<% if poll.questions.one? %>
<%= link_to_poll poll.questions.first.title, poll %>
- <%= dates %>
+
<%= dates %>
<% else %>
<%= link_to_poll poll.name, poll %>
- <%= dates %>
+
<%= dates %>
<% poll.questions.sort_for_list.each do |question| %>
diff --git a/spec/components/polls/poll_component_spec.rb b/spec/components/polls/poll_component_spec.rb
index ca4ea271e..154b8419e 100644
--- a/spec/components/polls/poll_component_spec.rb
+++ b/spec/components/polls/poll_component_spec.rb
@@ -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)