Skip to content

Commit

Permalink
Merge pull request #2113 from alphagov/revert-2111-revert-2089-remove…
Browse files Browse the repository at this point in the history
…-register-to-vote-promo

Revert "Add Photo ID Promo"
  • Loading branch information
patrickpatrickpatrick authored Mar 25, 2024
2 parents 04a8d14 + 4c9c817 commit e6f8d2d
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 15 deletions.
1 change: 0 additions & 1 deletion app/assets/stylesheets/forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
left: -9999em;
}

.promotion-choice-bring-id-to-vote:checked ~ .promotion-choice-opt-in-out-url,
.promotion-choice-mot-reminder:checked ~ .promotion-choice-opt-in-out-url,
.promotion-choice-electric-vehicle:checked ~ .promotion-choice-opt-in-out-url {
position: absolute;
Expand Down
2 changes: 1 addition & 1 deletion app/lib/presentation_toggles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module PresentationToggles
included do
field :presentation_toggles, type: Hash, default: default_presentation_toggles
validates :promotion_choice_url, presence: true, if: :promotes_something?
validates :promotion_choice, inclusion: { in: %w[none organ_donor bring_id_to_vote mot_reminder electric_vehicle] }
validates :promotion_choice, inclusion: { in: %w[none organ_donor mot_reminder electric_vehicle] }
end

def promotion_choice=(value)
Expand Down
2 changes: 1 addition & 1 deletion app/presenters/formats/completed_transaction_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Formats
class CompletedTransactionPresenter < EditionFormatPresenter
private

PROMOTIONS = %w[organ_donor bring_id_to_vote mot_reminder electric_vehicle].freeze
PROMOTIONS = %w[organ_donor mot_reminder electric_vehicle].freeze

def schema_name
"completed_transaction"
Expand Down
4 changes: 0 additions & 4 deletions app/views/completed_transactions/_fields.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
{ checked: (f.object.promotion_choice == "organ_donor"), disabled: @resource.locked_for_edits?, class: 'promotion-choice-organ-donor' } %>
<%= f.label :promotion_choice, "Promote organ donation", value: 'organ_donor' %>
<br />
<%= f.radio_button :promotion_choice, 'bring_id_to_vote',
{ checked: (f.object.promotion_choice == "bring_id_to_vote"), disabled: @resource.locked_for_edits?, class: 'promotion-choice-bring-id-to-vote' } %>
<%= f.label :promotion_choice, "Promote bring photo ID to vote", value: 'bring_id_to_vote' %>
<br />
<%= f.radio_button :promotion_choice, 'mot_reminder',
{ checked: (f.object.promotion_choice == "mot_reminder"), disabled: @resource.locked_for_edits?, class: 'promotion-choice-mot-reminder' } %>
<%= f.label :promotion_choice, "Promote MOT reminders", value: 'mot_reminder' %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,5 @@ class CompletedTransactionCreateEditTest < JavascriptIntegrationTest
assert page.has_content? "Don't promote anything on this page"
assert page.has_content? "Promote organ donation"
assert page.has_content? "Promote MOT reminders"
assert page.has_content? "Promote bring photo ID to vote"
end
end
7 changes: 0 additions & 7 deletions test/models/completed_transaction_edition_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ class CompletedTransactionEditionTest < ActiveSupport::TestCase
assert_equal "https://www.organdonation.nhs.uk/registration/in/", completed_transaction_edition.promotion_choice_opt_in_url
assert_equal "https://www.organdonation.nhs.uk/registration/out/", completed_transaction_edition.promotion_choice_opt_out_url

completed_transaction_edition.promotion_choice = "bring_id_to_vote"
completed_transaction_edition.promotion_choice_url = "https://www.gov.uk/how-to-vote/photo-id-youll-need"
completed_transaction_edition.save!

assert_equal "bring_id_to_vote", completed_transaction_edition.reload.promotion_choice
assert_equal "https://www.gov.uk/how-to-vote/photo-id-youll-need", completed_transaction_edition.promotion_choice_url

completed_transaction_edition.promotion_choice = "mot_reminder"
completed_transaction_edition.promotion_choice_url = "https://www.gov.uk/mot-reminder"
completed_transaction_edition.save!
Expand Down

0 comments on commit e6f8d2d

Please sign in to comment.