Skip to content

Commit

Permalink
Merge pull request #676 from alphagov/update-holiday-messaging
Browse files Browse the repository at this point in the history
Update holiday messaging
  • Loading branch information
pixeltrix authored Dec 20, 2018
2 parents 0298cfc + da563ab commit 6aa8671
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

<p><%= Site.threshold_for_moderation %> people need to click the link and confirm their support for us to publish your petition.</p>

<% if christmas_period? %>
<p>Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does we’ll publish it. This usually takes a week or less but over the Christmas period it will take us a little longer than usual. We’ll check your petition as quickly as we can.</p>
<% elsif easter_period? %>
<p>Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does we’ll publish it. This usually takes a week or less but over the Easter period it will take us a little longer than usual. We’ll check your petition as quickly as we can.</p>
<% else %>
<p>Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less.</p>
<% end %>

<p>Thanks,<br />
<%= t("petitions.emails.signoff_prefix") %><br />
<%= t("petitions.emails.signoff_suffix") %></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ Forward the email below to your potential supporters.

<%= Site.threshold_for_moderation %> people need to click the link and confirm their support for us to publish your petition.

<% if christmas_period? %>
Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does we’ll publish it. This usually takes a week or less but over the Christmas period it will take us a little longer than usual. We’ll check your petition as quickly as we can.
<% elsif easter_period? %>
Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does we’ll publish it. This usually takes a week or less but over the Easter period it will take us a little longer than usual. We’ll check your petition as quickly as we can.
<% else %>
Once you’ve gained the required number of supporters, we’ll check your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less.
<% end %>

Thanks,
<%= t("petitions.emails.signoff_prefix") %>
<%= t("petitions.emails.signoff_suffix") %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<p><%= @sponsor.name %> supported your petition – “<%= @petition.action %>”.</p>

<% if christmas_period? %>
<p><%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Christmas period it may take us a little longer than usual. We’ll check your petition as quickly as we can.</p>
<p><%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Christmas period it will take us a little longer than usual. We’ll check your petition as quickly as we can.</p>
<% elsif easter_period? %>
<p><%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Easter period it may take us a little longer than usual. We’ll check your petition as quickly as we can.</p>
<p><%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Easter period it will take us a little longer than usual. We’ll check your petition as quickly as we can.</p>
<% else %>
<p><%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less.</p>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ Your petition is nearly ready to go.
<%= @sponsor.name %> supported your petition – "<%= @petition.action %>".

<% if christmas_period? %>
<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Christmas period it may take us a little longer than usual. We’ll check your petition as quickly as we can.
<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Christmas period it will take us a little longer than usual. We’ll check your petition as quickly as we can.
<% elsif christmas_period? %>
<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Easter period it may take us a little longer than usual. We’ll check your petition as quickly as we can.
<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less but over the Easter period it will take us a little longer than usual. We’ll check your petition as quickly as we can.
<% else %>
<%= @sponsor_count %> people have supported your petition so far. We’re checking your petition to make sure it meets the petition standards. If it does, we’ll publish it. This usually takes a week or less.
<% end %>
Expand Down
24 changes: 24 additions & 0 deletions spec/mailers/petition_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,30 @@
it "includes the petition additional details" do
expect(mail).to have_body_text(%r[To promote organic vegetables])
end

it "includes information about moderation" do
expect(mail).to have_body_text(%r[Once you’ve gained the required number of supporters])
end

context "during Christmas" do
before do
allow(Holiday).to receive(:christmas?).and_return(true)
end

it "includes information about delayed moderation" do
expect(mail).to have_body_text(%r[but over the Christmas period it will take us a little longer])
end
end

context "during Easter" do
before do
allow(Holiday).to receive(:easter?).and_return(true)
end

it "includes information about delayed moderation" do
expect(mail).to have_body_text(%r[but over the Easter period it will take us a little longer])
end
end
end

describe "notifying signature of debate outcome" do
Expand Down
12 changes: 6 additions & 6 deletions spec/mailers/sponsor_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
it_behaves_like "a sponsor signed on threshold email"

it "doesn't include the moderation delay message" do
expect(mail).not_to have_body_text(%r[over the Christmas period it may take us a little longer than usual])
expect(mail).not_to have_body_text(%r[over the Christmas period it will take us a little longer than usual])
end
end

Expand All @@ -143,7 +143,7 @@
it_behaves_like "a sponsor signed on threshold email"

it "includes the moderation delay message" do
expect(mail).to have_body_text(%r[over the Christmas period it may take us a little longer than usual])
expect(mail).to have_body_text(%r[over the Christmas period it will take us a little longer than usual])
end
end

Expand All @@ -155,7 +155,7 @@
it_behaves_like "a sponsor signed on threshold email"

it "doesn't include the moderation delay message" do
expect(mail).not_to have_body_text(%r[over the Christmas period it may take us a little longer than usual])
expect(mail).not_to have_body_text(%r[over the Christmas period it will take us a little longer than usual])
end
end

Expand All @@ -167,7 +167,7 @@
it_behaves_like "a sponsor signed on threshold email"

it "doesn't include the moderation delay message" do
expect(mail).not_to have_body_text(%r[over the Easter period it may take us a little longer than usual])
expect(mail).not_to have_body_text(%r[over the Easter period it will take us a little longer than usual])
end
end

Expand All @@ -179,7 +179,7 @@
it_behaves_like "a sponsor signed on threshold email"

it "includes the moderation delay message" do
expect(mail).to have_body_text(%r[over the Easter period it may take us a little longer than usual])
expect(mail).to have_body_text(%r[over the Easter period it will take us a little longer than usual])
end
end

Expand All @@ -191,7 +191,7 @@
it_behaves_like "a sponsor signed on threshold email"

it "doesn't include the moderation delay message" do
expect(mail).not_to have_body_text(%r[over the Easter period it may take us a little longer than usual])
expect(mail).not_to have_body_text(%r[over the Easter period it will take us a little longer than usual])
end
end
end
Expand Down

0 comments on commit 6aa8671

Please sign in to comment.