adds pagination to 1st level comments in debate

Ref: #80
This commit is contained in:
Juanjo Bazán
2015-08-19 13:55:10 +02:00
committed by Juanjo Bazán
parent 10d7e9effe
commit 3732b7f420
3 changed files with 20 additions and 1 deletions

View File

@@ -19,6 +19,24 @@ feature 'Comments' do
end
end
scenario 'Paginated comments' do
debate = create(:debate)
per_page = Kaminari.config.default_per_page
(per_page + 2).times { create(:comment, commentable: debate)}
visit debate_path(debate)
expect(page).to have_css('.comment', count: per_page)
within("nav.pagination") do
expect(page).to have_content("1")
expect(page).to have_content("2")
expect(page).to_not have_content("3")
click_link "Next"
end
expect(page).to have_css('.comment', count: 2)
end
feature 'Not logged user' do
scenario 'can not see comments forms' do
debate = create(:debate)