displays only the first 5 proposals to print

This commit is contained in:
rgarcia
2015-10-20 14:45:59 +02:00
parent c2b9745401
commit 8acd119b19
3 changed files with 3 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ class Management::ProposalsController < Management::BaseController
end
def print
@proposals = Proposal.all.page(params[:page]).for_render.send("sort_by_#{@current_order}")
@proposals = Proposal.send("sort_by_#{@current_order}").limit(5)
set_proposal_votes(@proposal)
end

View File

@@ -13,7 +13,6 @@
</div>
<%= render @proposals %>
<%= paginate @proposals %>
</div>
</div>
</section>

View File

@@ -104,10 +104,11 @@ feature 'Proposals' do
context "Printing" do
scenario 'Printing proposals', :js do
5.times { create(:proposal) }
6.times { create(:proposal) }
click_link "Print proposals"
expect(page).to have_css('.proposal', count: 5)
find("#print_link").click
### CHANGE ME