Skip to content

Commit 6aa8671

Browse files
authored
Merge pull request #676 from alphagov/update-holiday-messaging
Update holiday messaging
2 parents 0298cfc + da563ab commit 6aa8671

6 files changed

Lines changed: 50 additions & 10 deletions

app/views/petition_mailer/gather_sponsors_for_petition.html.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

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

9+
<% if christmas_period? %>
10+
<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>
11+
<% elsif easter_period? %>
12+
<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>
13+
<% else %>
14+
<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>
15+
<% end %>
16+
917
<p>Thanks,<br />
1018
<%= t("petitions.emails.signoff_prefix") %><br />
1119
<%= t("petitions.emails.signoff_suffix") %></p>

app/views/petition_mailer/gather_sponsors_for_petition.text.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ Forward the email below to your potential supporters.
66

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

9+
<% if christmas_period? %>
10+
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.
11+
<% elsif easter_period? %>
12+
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.
13+
<% else %>
14+
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.
15+
<% end %>
16+
917
Thanks,
1018
<%= t("petitions.emails.signoff_prefix") %>
1119
<%= t("petitions.emails.signoff_suffix") %>

app/views/sponsor_mailer/sponsor_signed_email_on_threshold.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
<p><%= @sponsor.name %> supported your petition – “<%= @petition.action %>”.</p>
66

77
<% if christmas_period? %>
8-
<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>
8+
<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>
99
<% elsif easter_period? %>
10-
<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>
10+
<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>
1111
<% else %>
1212
<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>
1313
<% end %>

app/views/sponsor_mailer/sponsor_signed_email_on_threshold.text.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Your petition is nearly ready to go.
55
<%= @sponsor.name %> supported your petition – "<%= @petition.action %>".
66

77
<% if christmas_period? %>
8-
<%= @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.
8+
<%= @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.
99
<% elsif christmas_period? %>
10-
<%= @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.
10+
<%= @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.
1111
<% else %>
1212
<%= @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.
1313
<% end %>

spec/mailers/petition_mailer_spec.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,30 @@
334334
it "includes the petition additional details" do
335335
expect(mail).to have_body_text(%r[To promote organic vegetables])
336336
end
337+
338+
it "includes information about moderation" do
339+
expect(mail).to have_body_text(%r[Once you’ve gained the required number of supporters])
340+
end
341+
342+
context "during Christmas" do
343+
before do
344+
allow(Holiday).to receive(:christmas?).and_return(true)
345+
end
346+
347+
it "includes information about delayed moderation" do
348+
expect(mail).to have_body_text(%r[but over the Christmas period it will take us a little longer])
349+
end
350+
end
351+
352+
context "during Easter" do
353+
before do
354+
allow(Holiday).to receive(:easter?).and_return(true)
355+
end
356+
357+
it "includes information about delayed moderation" do
358+
expect(mail).to have_body_text(%r[but over the Easter period it will take us a little longer])
359+
end
360+
end
337361
end
338362

339363
describe "notifying signature of debate outcome" do

spec/mailers/sponsor_mailer_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@
131131
it_behaves_like "a sponsor signed on threshold email"
132132

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

@@ -143,7 +143,7 @@
143143
it_behaves_like "a sponsor signed on threshold email"
144144

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

@@ -155,7 +155,7 @@
155155
it_behaves_like "a sponsor signed on threshold email"
156156

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

@@ -167,7 +167,7 @@
167167
it_behaves_like "a sponsor signed on threshold email"
168168

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

@@ -179,7 +179,7 @@
179179
it_behaves_like "a sponsor signed on threshold email"
180180

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

@@ -191,7 +191,7 @@
191191
it_behaves_like "a sponsor signed on threshold email"
192192

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

0 commit comments

Comments
 (0)