diff --git a/spec/system/proposal_notifications_spec.rb b/spec/system/proposal_notifications_spec.rb index b26f9606e..f41be4d65 100644 --- a/spec/system/proposal_notifications_spec.rb +++ b/spec/system/proposal_notifications_spec.rb @@ -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