adds pending filter to admin/comments

This commit is contained in:
Juanjo Bazán
2015-09-06 21:45:41 +02:00
parent 1a7806150a
commit bc90812d37
5 changed files with 21 additions and 9 deletions

View File

@@ -24,22 +24,31 @@ feature 'Admin comments' do
click_link 'Confirm'
expect(page).to_not have_content(comment.body)
click_link('Confirmed')
expect(page).to have_content(comment.body)
expect(page).to have_content('Confirmed')
expect(comment.reload).to be_confirmed_hide
end
scenario "Current filter is properly highlighted" do
visit admin_comments_path
expect(page).to_not have_link('All')
expect(page).to_not have_link('Pending')
expect(page).to have_link('All')
expect(page).to have_link('Confirmed')
visit admin_comments_path(filter: 'Pending')
expect(page).to_not have_link('Pending')
expect(page).to have_link('All')
expect(page).to have_link('Confirmed')
visit admin_comments_path(filter: 'all')
expect(page).to have_link('Pending')
expect(page).to_not have_link('All')
expect(page).to have_link('Confirmed')
visit admin_comments_path(filter: 'with_confirmed_hide')
expect(page).to have_link('Pending')
expect(page).to have_link('All')
expect(page).to_not have_link('Confirmed')
end