From 1d89fe0738db31bc2c58efeda4c4504033b73b2f Mon Sep 17 00:00:00 2001 From: taitus Date: Wed, 9 Jul 2025 14:06:55 +0200 Subject: [PATCH] Unify similar tests in proposal notifications spec The test "Link to send the message" was already included inside "Send a notification". We removed the first one to keep only one test that covers everything. --- spec/system/proposal_notifications_spec.rb | 27 ++++------------------ 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/spec/system/proposal_notifications_spec.rb b/spec/system/proposal_notifications_spec.rb index dff45c273..90257d827 100644 --- a/spec/system/proposal_notifications_spec.rb +++ b/spec/system/proposal_notifications_spec.rb @@ -2,13 +2,16 @@ require "rails_helper" describe "Proposal Notifications" do scenario "Send a notification" do - author = create(:user, :with_proposal) + author = create(:user) + proposal = create(:proposal, author: author) login_as(author) visit root_path click_link "My content" - click_link "Dashboard" + within("#proposal_#{proposal.id}") do + click_link "Dashboard" + end within("#side_menu") do click_link "Message to users" @@ -142,26 +145,6 @@ describe "Proposal Notifications" do end context "Permissions" do - scenario "Link to send the message" do - author = create(:user) - proposal = create(:proposal, author: author) - - login_as(author) - visit root_path - - click_link "My content" - - within("#proposal_#{proposal.id}") do - click_link "Dashboard" - end - - within("#side_menu") do - click_link "Message to users" - end - - expect(page).to have_link "Send notification to proposal followers" - end - scenario "Accessing form directly" do user = create(:user) author = create(:user)