adds filtering of tags for spending proposals

This commit is contained in:
rgarcia
2016-03-08 13:57:58 +01:00
parent 837ad5fb1b
commit cd8cbef389
8 changed files with 46 additions and 2 deletions

View File

@@ -162,6 +162,26 @@ feature 'Admin spending proposals' do
expect(page).to have_content("Old idea")
end
scenario "Index filtering by tag" do
create(:spending_proposal, title: 'Educate the children', tag_list: 'Education')
create(:spending_proposal, title: 'More schools', tag_list: 'Education')
create(:spending_proposal, title: 'More hospitals', tag_list: 'Health')
visit admin_spending_proposals_path
expect(page).to have_css(".spending_proposal", count: 3)
expect(page).to have_content("Educate the children")
expect(page).to have_content("More schools")
expect(page).to have_content("More hospitals")
visit admin_spending_proposals_path(tag_name: 'Education')
expect(page).to have_css(".spending_proposal", count: 2)
expect(page).to have_content("Educate the children")
expect(page).to have_content("More schools")
expect(page).to_not have_content("More hospitals")
end
scenario 'Show' do
administrator = create(:administrator, user: create(:user, username: 'Ana', email: 'ana@admins.org'))
valuator = create(:valuator, user: create(:user, username: 'Rachel', email: 'rachel@valuators.org'))