adds topic notifications specs

This commit is contained in:
decabeza
2017-10-20 17:07:44 +02:00
parent 796fe333e3
commit 45133a917f

View File

@@ -14,6 +14,12 @@ feature "Notifications" do
let(:legislation_question) { create(:legislation_question, process: process, author: administrator) }
let(:legislation_annotation) { create(:legislation_annotation, author: author) }
let(:topic) {
proposal = create(:proposal)
community = proposal.community
create(:topic, community: community, author: author)
}
scenario "User commented on my debate", :js do
create(:notification, notifiable: debate, user: author)
login_as author
@@ -40,6 +46,19 @@ feature "Notifications" do
expect(page).to have_xpath "//a[@href='#{notification_path(Notification.last)}']"
end
scenario "User commented on my topic", :js do
create(:notification, notifiable: topic, user: author)
login_as author
visit root_path
find(".icon-notification").click
expect(page).to have_css ".notification", count: 1
expect(page).to have_content "Someone commented on"
expect(page).to have_xpath "//a[@href='#{notification_path(Notification.last)}']"
end
scenario "Multiple comments on my proposal", :js do
login_as user
visit proposal_path proposal