Skip to content

Commit

Permalink
Merge pull request #459 from alphagov/change-debate-wording
Browse files Browse the repository at this point in the history
Change 'To be debated on' to 'Scheduled for debate on'
  • Loading branch information
alanth committed Apr 22, 2016
2 parents 077ced0 + d3f69e6 commit 5e0e785
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/helpers/date_time_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def api_date_format(date_time)
end
end

def to_be_debated_on_in_words(date, today = Date.current)
scope = :"petitions.to_be_debated_on_in_words"
def scheduled_for_debate_in_words(date, today = Date.current)
scope = :"petitions.scheduled_for_debate_in_words"
days = (date - today).to_i
key = TO_BE_DEBATED_KEYS[days]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
<p><%= signature_count(:default, petition.signature_count) %></p>
<p><%= waiting_for_in_words(petition.debate_threshold_reached_at) %></p>
<% if petition.scheduled_debate_date? %>
<p><%= to_be_debated_on_in_words(petition.scheduled_debate_date) %></p>
<p><%= scheduled_for_debate_in_words(petition.scheduled_debate_date) %></p>
<% end %>
8 changes: 4 additions & 4 deletions config/locales/petitions.en-GB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ en-GB:
one: "Waiting for 1 day"
other: "Waiting for %{formatted_count} days"

to_be_debated_on_in_words:
today: "To be debated today"
tomorrow: "To be debated tomorrow"
other: "To be debated on %{formatted_date}"
scheduled_for_debate_in_words:
today: "Scheduled for debate today"
tomorrow: "Scheduled for debate tomorrow"
other: "Scheduled for debate on %{formatted_date}"

signature_counts:
default:
Expand Down
14 changes: 7 additions & 7 deletions spec/helpers/date_time_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,28 +109,28 @@
end
end

describe "#to_be_debated_on_in_words" do
describe "#scheduled_for_debate_in_words" do
context "when the date is today" do
let(:date) { Date.parse("11/11/2016") }

it "returns 'To be debated on 11 November 2016'" do
expect(helper.to_be_debated_on_in_words(date)).to eq("To be debated on 11 November 2016")
it "returns 'Scheduled for debate on 11 November 2016'" do
expect(helper.scheduled_for_debate_in_words(date)).to eq("Scheduled for debate on 11 November 2016")
end
end

context "when the date is today" do
let(:date) { Date.current }

it "returns 'To be debated today'" do
expect(helper.to_be_debated_on_in_words(date)).to eq("To be debated today")
it "returns 'Scheduled for debate today'" do
expect(helper.scheduled_for_debate_in_words(date)).to eq("Scheduled for debate today")
end
end

context "when the date is tomorrow" do
let(:date) { Date.tomorrow }

it "returns 'To be debated tomorrow'" do
expect(helper.to_be_debated_on_in_words(date)).to eq("To be debated tomorrow")
it "returns 'Scheduled for debate tomorrow'" do
expect(helper.scheduled_for_debate_in_words(date)).to eq("Scheduled for debate tomorrow")
end
end
end
Expand Down

0 comments on commit 5e0e785

Please sign in to comment.