Skip to content

Commit

Permalink
Merge pull request #382 from alphagov/whn-markdown-cheanup
Browse files Browse the repository at this point in the history
Remove what_happens_next_text column
  • Loading branch information
DavidBiddle authored Dec 6, 2023
2 parents bd8b8d6 + 0c4d872 commit 5e9bb46
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 128 deletions.
2 changes: 1 addition & 1 deletion app/service/task_status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def declaration_status
end

def what_happens_next_status
if @form.what_happens_next_text.present? || @form.what_happens_next_markdown.present?
if @form.what_happens_next_markdown.present?
:completed
else
:not_started
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveWhatHappensNextTextFromForms < ActiveRecord::Migration[7.0]
def change
remove_column :forms, :what_happens_next_text, :text
end
end
3 changes: 1 addition & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@
submission_email:,
support_email: "[email protected]",
support_phone: "08000800",
what_happens_next_text: "Test",
what_happens_next_markdown: "Test",
)
all_question_types_form.make_live!
65 changes: 0 additions & 65 deletions lib/tasks/what_happens_next_markdown.rake

This file was deleted.

4 changes: 2 additions & 2 deletions spec/factories/forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
support_phone { nil }
support_url { nil }
support_url_text { nil }
what_happens_next_text { nil }
what_happens_next_markdown { nil }
declaration_text { nil }
question_section_completed { false }
declaration_section_completed { false }
Expand Down Expand Up @@ -44,7 +44,7 @@
trait :ready_for_live do
with_pages
support_email { Faker::Internet.email(domain: "example.gov.uk") }
what_happens_next_text { "We usually respond to applications within 10 working days." }
what_happens_next_markdown { "We usually respond to applications within 10 working days." }
question_section_completed { true }
declaration_section_completed { true }
end
Expand Down
46 changes: 0 additions & 46 deletions spec/lib/tasks/what_happens_next_markdown_spec.rb

This file was deleted.

3 changes: 1 addition & 2 deletions spec/models/form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@
"privacy_policy_url",
"form_slug",
"start_page",
"what_happens_next_text",
"support_email",
"support_phone",
"support_url",
Expand Down Expand Up @@ -309,7 +308,7 @@
attribute_value: [],
},
{
attribute: :what_happens_next_text,
attribute: :what_happens_next_markdown,
attribute_value: nil,
},
{
Expand Down
1 change: 0 additions & 1 deletion spec/request/api/v1/forms_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@
privacy_policy_url: nil,
form_slug: "test-form-1",
start_page: nil,
what_happens_next_text: nil,
what_happens_next_markdown: nil,
support_email: nil,
support_phone: nil,
Expand Down
8 changes: 0 additions & 8 deletions spec/service/task_status_service_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,6 @@
end
end

context "with a form which has a what_happens_next_text" do
let(:form) { build(:form, :new_form, what_happens_next_text: "We usually respond to applications within 10 working days.") }

it "returns the completed status" do
expect(task_status_service.task_statuses[:what_happens_next_status]).to eq :completed
end
end

context "with a form which has a what_happens_next_markdown" do
let(:form) { build(:form, :new_form, what_happens_next_markdown: "We usually respond to applications within 10 working days.") }

Expand Down

0 comments on commit 5e9bb46

Please sign in to comment.