fixes specs
This commit is contained in:
@@ -13,6 +13,7 @@ class Management::ProposalsController < Management::BaseController
|
|||||||
|
|
||||||
def show
|
def show
|
||||||
super
|
super
|
||||||
|
@notifications = @proposal.notifications
|
||||||
redirect_to management_proposal_path(@proposal), status: :moved_permanently if request.path != management_proposal_path(@proposal)
|
redirect_to management_proposal_path(@proposal), status: :moved_permanently if request.path != management_proposal_path(@proposal)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@
|
|||||||
<td style="padding-left: 10px;">
|
<td style="padding-left: 10px;">
|
||||||
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px; margin: 0; font-style: italic; padding-bottom: 20px;">
|
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px; margin: 0; font-style: italic; padding-bottom: 20px;">
|
||||||
<%= t('mailers.direct_message_for_receiver.unsubscribe',
|
<%= t('mailers.direct_message_for_receiver.unsubscribe',
|
||||||
account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'),
|
account: link_to(t('mailers.direct_message_for_receiver.unsubscribe_account'),
|
||||||
account_path, style: "color: #2895F1; text-decoration: none;")).html_safe %>
|
account_url, style: "color: #2895F1; text-decoration: none;")).html_safe %>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px; margin: 0; font-style: italic; padding-bottom: 20px;">
|
<p style="font-family: 'Open Sans','Helvetica Neue',arial,sans-serif;font-size: 14px;font-weight: normal;line-height: 24px; margin: 0; font-style: italic; padding-bottom: 20px;">
|
||||||
<%= t('mailers.proposal_notification_digest.unsubscribe',
|
<%= t('mailers.proposal_notification_digest.unsubscribe',
|
||||||
account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'),
|
account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'),
|
||||||
account_path, style: "color: #2895F1; text-decoration: none;")).html_safe %>
|
account_url, style: "color: #2895F1; text-decoration: none;")).html_safe %>
|
||||||
</p>
|
</p>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ search:
|
|||||||
ignore_missing:
|
ignore_missing:
|
||||||
- 'unauthorized.*'
|
- 'unauthorized.*'
|
||||||
- 'activerecord.errors.models.proposal_notification.*'
|
- 'activerecord.errors.models.proposal_notification.*'
|
||||||
|
- 'activerecord.errors.models.direct_message.*'
|
||||||
- 'errors.messages.blank'
|
- 'errors.messages.blank'
|
||||||
- 'errors.messages.taken'
|
- 'errors.messages.taken'
|
||||||
- 'devise.failure.invalid'
|
- 'devise.failure.invalid'
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ en:
|
|||||||
accept_terms_title: I agree to the Privacy Policy and the Terms and conditions of use
|
accept_terms_title: I agree to the Privacy Policy and the Terms and conditions of use
|
||||||
conditions: Terms and conditions of use
|
conditions: Terms and conditions of use
|
||||||
debate: Debate
|
debate: Debate
|
||||||
|
direct_message: private message
|
||||||
error: error
|
error: error
|
||||||
errors: errors
|
errors: errors
|
||||||
not_saved: 'prevented this %{resource} from being saved:'
|
not_saved: 'prevented this %{resource} from being saved:'
|
||||||
|
|||||||
@@ -168,7 +168,10 @@ feature 'Commenting proposals' do
|
|||||||
|
|
||||||
within "#comments" do
|
within "#comments" do
|
||||||
expect(page).to have_content 'Have you thought about...?'
|
expect(page).to have_content 'Have you thought about...?'
|
||||||
expect(page).to have_content '(1)'
|
end
|
||||||
|
|
||||||
|
within "#tab-comments-label" do
|
||||||
|
expect(page).to have_content 'Comments (1)'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ feature 'Emails' do
|
|||||||
email_digest.create
|
email_digest.create
|
||||||
|
|
||||||
email = open_last_email
|
email = open_last_email
|
||||||
expect(email).to have_subject("Email digest")
|
expect(email).to have_subject("Proposal notifications in Consul")
|
||||||
expect(email).to deliver_to(user.email)
|
expect(email).to deliver_to(user.email)
|
||||||
|
|
||||||
expect(email).to have_body_text(proposal1.title)
|
expect(email).to have_body_text(proposal1.title)
|
||||||
@@ -226,6 +226,7 @@ feature 'Emails' do
|
|||||||
expect(email).to have_body_text(proposal2.author.name)
|
expect(email).to have_body_text(proposal2.author.name)
|
||||||
|
|
||||||
expect(email).to_not have_body_text(proposal3.title)
|
expect(email).to_not have_body_text(proposal3.title)
|
||||||
|
expect(email).to have_body_text(/#{account_path}/)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ feature 'Proposal Notifications' do
|
|||||||
click_link "My activity"
|
click_link "My activity"
|
||||||
|
|
||||||
within("#proposal_#{proposal.id}") do
|
within("#proposal_#{proposal.id}") do
|
||||||
click_link "Send message"
|
click_link "Send notification"
|
||||||
end
|
end
|
||||||
|
|
||||||
fill_in 'proposal_notification_title', with: "Thank you for supporting my proposal"
|
fill_in 'proposal_notification_title', with: "Thank you for supporting my proposal"
|
||||||
@@ -48,7 +48,7 @@ feature 'Proposal Notifications' do
|
|||||||
visit new_proposal_notification_path(proposal_id: proposal.id)
|
visit new_proposal_notification_path(proposal_id: proposal.id)
|
||||||
|
|
||||||
expect(page).to have_content "This message will be send to 7 people and it will be visible in the proposal's page"
|
expect(page).to have_content "This message will be send to 7 people and it will be visible in the proposal's page"
|
||||||
expect(page).to have_link("the proposal's page", href: proposal_path(proposal))
|
expect(page).to have_link("the proposal's page", href: proposal_path(proposal, anchor: 'comments'))
|
||||||
end
|
end
|
||||||
|
|
||||||
context "Permissions" do
|
context "Permissions" do
|
||||||
@@ -62,7 +62,7 @@ feature 'Proposal Notifications' do
|
|||||||
visit user_path(author)
|
visit user_path(author)
|
||||||
|
|
||||||
within("#proposal_#{proposal.id}") do
|
within("#proposal_#{proposal.id}") do
|
||||||
expect(page).to have_link "Send message"
|
expect(page).to have_link "Send notification"
|
||||||
end
|
end
|
||||||
|
|
||||||
login_as(user)
|
login_as(user)
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ module CommonActions
|
|||||||
click_link "My activity"
|
click_link "My activity"
|
||||||
|
|
||||||
within("#proposal_#{proposal.id}") do
|
within("#proposal_#{proposal.id}") do
|
||||||
click_link "Send message"
|
click_link "Send notification"
|
||||||
end
|
end
|
||||||
|
|
||||||
fill_in 'proposal_notification_title', with: "Thank you for supporting my proposal #{proposal.title}"
|
fill_in 'proposal_notification_title', with: "Thank you for supporting my proposal #{proposal.title}"
|
||||||
@@ -224,6 +224,7 @@ module CommonActions
|
|||||||
|
|
||||||
fill_in 'direct_message_title', with: "Hey #{receiver.name}!"
|
fill_in 'direct_message_title', with: "Hey #{receiver.name}!"
|
||||||
fill_in 'direct_message_body', with: "How are you doing? This is #{sender.name}"
|
fill_in 'direct_message_body', with: "How are you doing? This is #{sender.name}"
|
||||||
|
|
||||||
click_button "Send message"
|
click_button "Send message"
|
||||||
|
|
||||||
expect(page).to have_content "You message has been sent successfully."
|
expect(page).to have_content "You message has been sent successfully."
|
||||||
|
|||||||
Reference in New Issue
Block a user