|
|
|
@ -693,8 +693,10 @@ RSpec.describe "Schemes scheme Features" do |
|
|
|
context "when I click to see individual scheme" do |
|
|
|
context "when I click to see individual scheme" do |
|
|
|
let(:scheme) { schemes.first } |
|
|
|
let(:scheme) { schemes.first } |
|
|
|
let!(:location) { FactoryBot.create(:location, startdate: Time.zone.local(2022, 4, 4), scheme:) } |
|
|
|
let!(:location) { FactoryBot.create(:location, startdate: Time.zone.local(2022, 4, 4), scheme:) } |
|
|
|
|
|
|
|
let!(:deactivated_location) { FactoryBot.create(:location, startdate: Time.zone.local(2022, 4, 4), scheme:) } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
|
|
|
|
deactivated_location.location_deactivation_periods << FactoryBot.create(:location_deactivation_period, deactivation_date: Time.zone.local(2022, 6, 4)) |
|
|
|
click_link(scheme.service_name) |
|
|
|
click_link(scheme.service_name) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
@ -752,6 +754,44 @@ RSpec.describe "Schemes scheme Features" do |
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/locations") |
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/locations") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when location is incative" do |
|
|
|
|
|
|
|
context "and I click to view the location" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link(deactivated_location.postcode) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "displays details about the selected location" do |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/locations/#{deactivated_location.id}") |
|
|
|
|
|
|
|
expect(page).to have_content(deactivated_location.postcode) |
|
|
|
|
|
|
|
expect(page).to have_content(deactivated_location.location_admin_district) |
|
|
|
|
|
|
|
expect(page).to have_content(deactivated_location.name) |
|
|
|
|
|
|
|
expect(page).to have_content(deactivated_location.units) |
|
|
|
|
|
|
|
expect(page).to have_content(deactivated_location.type_of_unit) |
|
|
|
|
|
|
|
expect(page).to have_content(deactivated_location.mobility_type) |
|
|
|
|
|
|
|
expect(page).to have_content(deactivated_location.location_code) |
|
|
|
|
|
|
|
expect(page).to have_content("Active from 4 April 2022 to 3 June 2022 Deactivated on 4 June 2022") |
|
|
|
|
|
|
|
expect(page).to have_content("Deactivated") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "allows to reactivate a location" do |
|
|
|
|
|
|
|
click_link("Reactivate this location") |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/locations/#{deactivated_location.id}/new-reactivation") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when I press the back button" do |
|
|
|
|
|
|
|
before do |
|
|
|
|
|
|
|
click_link "Back" |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "I see location details" do |
|
|
|
|
|
|
|
expect(page).to have_content scheme.locations.first.id |
|
|
|
|
|
|
|
expect(page).to have_current_path("/schemes/#{scheme.id}/locations") |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when I click to change location name" do |
|
|
|
context "when I click to change location name" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
click_link(location.postcode) |
|
|
|
click_link(location.postcode) |
|
|
|
|