Skip to content

Commit

Permalink
Complete proposal notification test
Browse files Browse the repository at this point in the history
We were finishing the test with the first "visit", so it was doing
nothing (other than potentially generating concurrency issues with other
tests).
  • Loading branch information
javierm committed Apr 4, 2022
1 parent 90c773a commit f96e544
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions spec/system/proposal_notifications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,24 @@
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 "proposal_notification_title", with: "Thank you for supporting my proposal"
fill_in "proposal_notification_body", 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
Expand Down

0 comments on commit f96e544

Please sign in to comment.