Users can now hide recommendations

This commit is contained in:
Angel Perez
2018-06-08 18:40:41 -04:00
parent fefa225f8a
commit 251441e109
3 changed files with 69 additions and 18 deletions

View File

@@ -833,6 +833,30 @@ feature 'Proposals' do
expect(page).not_to have_css('.recommendation', count: 3)
expect(page).not_to have_link('recommendations')
end
scenario 'Recommendations shown in index are dismissable', :js do
user = create(:user, recommended_proposals: true)
proposal = create(:proposal, tag_list: "Sport")
create(:follow, followable: proposal, user: user)
login_as(user)
visit proposals_path
within("#recommendations") do
expect(page).to have_content('Best')
expect(page).to have_content('Worst')
expect(page).to have_content('Medium')
expect(page).to have_css('.recommendation', count: 3)
find('.icon-x').click
expect(page).not_to have_content('Best')
expect(page).not_to have_content('Worst')
expect(page).not_to have_content('Medium')
expect(page).not_to have_css('.recommendation', count: 3)
end
end
end
end