Complete proposal notification test

We were finishing the test with the first "visit", so it was doing
nothing (other than potentially generating concurrency issues with other
tests).
This commit is contained in:
Javi Martín
2022-04-04 12:30:31 +02:00
parent e49c32638d
commit c0f71c4c8d

View File

@@ -313,12 +313,23 @@ describe "Proposal Notifications" do
scenario "Proposal retired by author" do
author = create(:user)
user = create(:user)
proposal = create(:proposal, author: author, voters: [user])
proposal = create(:proposal, :retired, author: author, followers: [user])
login_as(author)
visit root_path
visit new_proposal_notification_path(proposal_id: proposal.id)
fill_in "Title", with: "Thank you for supporting my proposal"
fill_in "Message", with: "Please share it with others so we can make it happen!"
click_button "Send notification"
expect(page).to have_content "Your message has been sent correctly."
logout
login_as(user)
visit notifications_path
expect(page).to have_content "This resource is not available anymore"
end
context "Group notifications" do