Running tests at the component level is faster than at the system level,
so we move tests from system/polls/results_spec.rb to the component.
Note that moving these tests removes vote_for_poll_via_web and the visit
to results_poll_path, but both are already covered in other tests. We
also take the opportunity to reuse the method in another test where
it makes sense.
Additionally, the spec title has been reverted from "Results for polls
with questions but without options" to "renders results for polls with
questions but without answers", as it was before commit 8997ed316c.
25 lines
644 B
Plaintext
25 lines
644 B
Plaintext
<% provide :title, poll.name %>
|
|
|
|
<div class="polls-results">
|
|
<%= render Polls::PollHeaderComponent.new(poll) %>
|
|
|
|
<%= render "polls/poll_subnav" %>
|
|
|
|
<div class="polls-results-content">
|
|
<div>
|
|
<p><strong><%= t("polls.show.results.title") %></strong></p>
|
|
<ul class="menu vertical">
|
|
<%- poll.questions.each do |question| %>
|
|
<li><%= link_to question.title, "##{question.title.parameterize}" %></li>
|
|
<% end %>
|
|
</ul>
|
|
</div>
|
|
|
|
<div>
|
|
<% poll.questions.each do |question| %>
|
|
<%= render Polls::Results::QuestionComponent.new(question) %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|