Skip to content

Commit a1d2b93

Browse files
committed
Change copy/revert service to markdown declaration
1 parent cf6cfe4 commit a1d2b93

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

spec/services/form_copy_service_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@
257257

258258
context "when source form has Welsh language version with translated content" do
259259
let(:source_form) do
260-
form = create(:form, :live, :with_pages, pages_count: 2, available_languages: %w[en cy], support_phone: "01234 567890", support_url: "https://example.gov.uk/support", support_url_text: "Our English support site", declaration_text: "English declaration", payment_url: "https://www.pay.gov.uk")
260+
form = create(:form, :live, :with_pages, pages_count: 2, available_languages: %w[en cy], support_phone: "01234 567890", support_url: "https://example.gov.uk/support", support_url_text: "Our English support site", declaration_markdown: "English declaration", payment_url: "https://www.pay.gov.uk")
261261
# Add an exit page condition to the first page
262262
form.pages.first.answer_type = "selection"
263263
form.pages.first.hint_text = "English hint text"
@@ -284,7 +284,7 @@
284284
form.support_phone_cy = "0800 111 222"
285285
form.support_url_cy = "https://example.com/cymorth"
286286
form.support_url_text_cy = "Cael cymorth"
287-
form.declaration_text_cy = "Rwy'n datgan bod hyn yn wir"
287+
form.declaration_markdown_cy = "Rwy'n datgan bod hyn yn wir"
288288
form.what_happens_next_markdown_cy = "Byddwn yn cysylltu â chi"
289289
form.payment_url_cy = "https://example.com/talu"
290290
form.save!
@@ -318,7 +318,7 @@
318318
expect(copied_welsh.content["support_phone"]).to eq("0800 111 222")
319319
expect(copied_welsh.content["support_url"]).to eq("https://example.com/cymorth")
320320
expect(copied_welsh.content["support_url_text"]).to eq("Cael cymorth")
321-
expect(copied_welsh.content["declaration_text"]).to eq("Rwy'n datgan bod hyn yn wir")
321+
expect(copied_welsh.content["declaration_markdown"]).to eq("Rwy'n datgan bod hyn yn wir")
322322
expect(copied_welsh.content["what_happens_next_markdown"]).to eq("Byddwn yn cysylltu â chi")
323323
expect(copied_welsh.content["payment_url"]).to eq("https://example.com/talu")
324324
end
@@ -331,7 +331,7 @@
331331
expect(copied_form.support_phone_cy).to eq("0800 111 222")
332332
expect(copied_form.support_url_cy).to eq("https://example.com/cymorth")
333333
expect(copied_form.support_url_text_cy).to eq("Cael cymorth")
334-
expect(copied_form.declaration_text_cy).to eq("Rwy'n datgan bod hyn yn wir")
334+
expect(copied_form.declaration_markdown_cy).to eq("Rwy'n datgan bod hyn yn wir")
335335
expect(copied_form.what_happens_next_markdown_cy).to eq("Byddwn yn cysylltu â chi")
336336
expect(copied_form.payment_url_cy).to eq("https://example.com/talu")
337337

spec/services/revert_draft_form_service_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ def revert_draft(tag)
139139

140140
context "when form has Welsh content" do
141141
let(:live_form) do
142-
form = create(:form, :live, :with_pages, pages_count: 2, available_languages: %w[en cy], support_phone: "01234 567890", support_url: "https://example.gov.uk/support", support_url_text: "Our English support site", declaration_text: "English declaration", payment_url: "https://www.pay.gov.uk")
142+
form = create(:form, :live, :with_pages, pages_count: 2, available_languages: %w[en cy], support_phone: "01234 567890", support_url: "https://example.gov.uk/support", support_url_text: "Our English support site", declaration_markdown: "English declaration", payment_url: "https://www.pay.gov.uk")
143143
# Set Welsh translations for the form
144144
form.name_cy = "Ffurflen Gymraeg"
145145
form.privacy_policy_url_cy = "https://example.com/preifatrwydd"
146146
form.support_email_cy = "cymorth@example.com"
147147
form.support_phone_cy = "0800 111 222"
148-
form.declaration_text_cy = "Rwy'n datgan bod hyn yn wir"
148+
form.declaration_markdown = "Rwy'n datgan bod hyn yn wir"
149149
form.save!
150150
form.pages.first.hint_text = "English first page hint text"
151151
form.pages.last.hint_text = "English last page hint text"
@@ -180,7 +180,7 @@ def revert_draft(tag)
180180
expect(live_form.privacy_policy_url_cy).to eq("https://example.com/preifatrwydd")
181181
expect(live_form.support_email_cy).to eq("cymorth@example.com")
182182
expect(live_form.support_phone_cy).to eq("0800 111 222")
183-
expect(live_form.declaration_text_cy).to eq("Rwy'n datgan bod hyn yn wir")
183+
expect(live_form.declaration_markdown_cy).to eq("Rwy'n datgan bod hyn yn wir")
184184

185185
# Check that page-level Welsh translations are restored
186186
expect(live_form.pages.first.question_text_cy).to eq("Cwestiwn Cymraeg 1")

0 commit comments

Comments
 (0)