adds link to send message from my activity
This commit is contained in:
@@ -6,9 +6,17 @@ feature 'Proposal Notifications' do
|
||||
noelia = create(:user)
|
||||
vega = create(:user)
|
||||
|
||||
proposal = create(:proposal)
|
||||
#use correct path from my activity
|
||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||
author = create(:user)
|
||||
proposal = create(:proposal, author: author)
|
||||
|
||||
login_as(author)
|
||||
visit root_path
|
||||
|
||||
click_link "My activity"
|
||||
|
||||
within("#proposal_#{proposal.id}") do
|
||||
click_link "Send message"
|
||||
end
|
||||
|
||||
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!"
|
||||
@@ -19,6 +27,30 @@ feature 'Proposal Notifications' do
|
||||
expect(page).to have_content "Please share it with others so we can make it happen!"
|
||||
end
|
||||
|
||||
context "Permissions" do
|
||||
|
||||
scenario "Link to send the message" do
|
||||
user = create(:user)
|
||||
author = create(:user)
|
||||
proposal = create(:proposal, author: author)
|
||||
|
||||
login_as(author)
|
||||
visit user_path(author)
|
||||
|
||||
within("#proposal_#{proposal.id}") do
|
||||
expect(page).to have_link "Send message"
|
||||
end
|
||||
|
||||
login_as(user)
|
||||
visit user_path(author)
|
||||
|
||||
within("#proposal_#{proposal.id}") do
|
||||
expect(page).to_not have_link "Send message"
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
scenario "Error messages" do
|
||||
proposal = create(:proposal)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user