Browse Source

amend naming error after rebase conflict

remove test that is no longer correct after change on another branch to functionality
update a test after a copy change
pull/1396/head
Arthur Campbell 3 years ago
parent
commit
bd423af228
  1. 2
      app/views/locations/toggle_active.html.erb
  2. 2
      spec/models/location_deactivation_period_spec.rb
  3. 13
      spec/models/scheme_deactivation_period_spec.rb

2
app/views/locations/toggle_active.html.erb

@ -11,7 +11,7 @@
<%= form_with model: @location_deactivation_period, url: toggle_location_form_path(action, @location), method: "patch", local: true do |f| %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<% collection_start_date = FormHandler.instance.earliest_open_collection_start_date(now: @location.available_from) %>
<% start_date = FormHandler.instance.earliest_open_collection_start_date(now: @location.available_from) %>
<%= f.govuk_error_summary %>
<%= f.govuk_radio_buttons_fieldset date_type_question(action),
legend: { text: I18n.t("questions.location.toggle_active.apply_from") },

2
spec/models/location_deactivation_period_spec.rb

@ -74,7 +74,7 @@ RSpec.describe LocationDeactivationPeriod do
location.location_deactivation_periods.clear
validator.validate(record)
start_date = startdate.to_formatted_s(:govuk_date)
expect(record.errors[:deactivation_date]).to include "The location cannot be deactivated before #{start_date}, the start of the collection year when it was created"
expect(record.errors[:deactivation_date]).to include "The location cannot be deactivated before #{start_date}, the date when it was first available"
end
end
end

13
spec/models/scheme_deactivation_period_spec.rb

@ -63,19 +63,6 @@ RSpec.describe SchemeDeactivationPeriod do
expect(record.errors[:deactivation_date]).to be_empty
end
end
context "but the scheme was created in the current collection period" do
let(:scheme) { FactoryBot.create(:scheme, created_at: now - 2.days) }
context "with a deactivation date in the previous collection period" do
it "adds an error" do
record.deactivation_date = now - 1.year
scheme.scheme_deactivation_periods.clear
validator.validate(record)
expect(record.errors[:deactivation_date]).to include "The scheme cannot be deactivated before 1 April 2023, the start of the collection year when it was created"
end
end
end
end
end
end

Loading…
Cancel
Save