fixes specs

This commit is contained in:
rgarcia
2016-06-16 12:06:26 +02:00
parent b3fd5e225a
commit 18dd9c95f3
10 changed files with 18 additions and 10 deletions

View File

@@ -13,6 +13,7 @@ class Management::ProposalsController < Management::BaseController
def show
super
@notifications = @proposal.notifications
redirect_to management_proposal_path(@proposal), status: :moved_permanently if request.path != management_proposal_path(@proposal)
end

View File

@@ -27,8 +27,8 @@
<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;">
<%= t('mailers.direct_message_for_receiver.unsubscribe',
account: link_to(t('mailers.proposal_notification_digest.unsubscribe_account'),
account_path, style: "color: #2895F1; text-decoration: none;")).html_safe %>
account: link_to(t('mailers.direct_message_for_receiver.unsubscribe_account'),
account_url, style: "color: #2895F1; text-decoration: none;")).html_safe %>
</p>
</td>
</tr>

View File

@@ -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;">
<%= t('mailers.proposal_notification_digest.unsubscribe',
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>
</td>
</tr>

View File

@@ -96,6 +96,7 @@ search:
ignore_missing:
- 'unauthorized.*'
- 'activerecord.errors.models.proposal_notification.*'
- 'activerecord.errors.models.direct_message.*'
- 'errors.messages.blank'
- 'errors.messages.taken'
- 'devise.failure.invalid'

View File

@@ -143,6 +143,7 @@ en:
accept_terms_title: I agree to the Privacy Policy and the Terms and conditions of use
conditions: Terms and conditions of use
debate: Debate
direct_message: private message
error: error
errors: errors
not_saved: 'prevented this %{resource} from being saved:'

View File

@@ -77,4 +77,4 @@ Setting['banner-img.banner-img-three'] = "Banner image 3"
# Proposal notifications
Setting['proposal_notification_minimum_interval_in_days '] = 3
Setting['direct_message_max_per_day '] = 3
Setting['direct_message_max_per_day'] = 3

View File

@@ -168,7 +168,10 @@ feature 'Commenting proposals' do
within "#comments" do
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

View File

@@ -205,7 +205,7 @@ feature 'Emails' do
email_digest.create
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 have_body_text(proposal1.title)
@@ -226,6 +226,7 @@ feature 'Emails' do
expect(email).to have_body_text(proposal2.author.name)
expect(email).to_not have_body_text(proposal3.title)
expect(email).to have_body_text(/#{account_path}/)
end
end

View File

@@ -12,7 +12,7 @@ feature 'Proposal Notifications' do
click_link "My activity"
within("#proposal_#{proposal.id}") do
click_link "Send message"
click_link "Send notification"
end
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)
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
context "Permissions" do
@@ -62,7 +62,7 @@ feature 'Proposal Notifications' do
visit user_path(author)
within("#proposal_#{proposal.id}") do
expect(page).to have_link "Send message"
expect(page).to have_link "Send notification"
end
login_as(user)

View File

@@ -203,7 +203,7 @@ module CommonActions
click_link "My activity"
within("#proposal_#{proposal.id}") do
click_link "Send message"
click_link "Send notification"
end
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_body', with: "How are you doing? This is #{sender.name}"
click_button "Send message"
expect(page).to have_content "You message has been sent successfully."