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:
@@ -313,12 +313,23 @@ describe "Proposal Notifications" do
|
|||||||
scenario "Proposal retired by author" do
|
scenario "Proposal retired by author" do
|
||||||
author = create(:user)
|
author = create(:user)
|
||||||
user = create(:user)
|
user = create(:user)
|
||||||
proposal = create(:proposal, author: author, voters: [user])
|
proposal = create(:proposal, :retired, author: author, followers: [user])
|
||||||
|
|
||||||
login_as(author)
|
login_as(author)
|
||||||
visit root_path
|
|
||||||
|
|
||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
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
|
end
|
||||||
|
|
||||||
context "Group notifications" do
|
context "Group notifications" do
|
||||||
|
|||||||
Reference in New Issue
Block a user