|
|
|
@ -867,21 +867,27 @@ RSpec.describe LocationsController, type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "shows locations with correct data" do |
|
|
|
it "shows locations with correct data wben the new locations layout feature toggle is enabled" do |
|
|
|
locations.each do |location| |
|
|
|
locations.each do |location| |
|
|
|
expect(page).to have_content(location.id) |
|
|
|
expect(page).to have_content(location.id) |
|
|
|
expect(page).to have_content(location.postcode) |
|
|
|
expect(page).to have_content(location.postcode) |
|
|
|
if FeatureToggle.new_locations_table_layout_enabled? |
|
|
|
|
|
|
|
expect(page).to have_content(location.name) |
|
|
|
expect(page).to have_content(location.name) |
|
|
|
expect(page).to have_content(location.status) |
|
|
|
expect(page).to have_content(location.status) |
|
|
|
else |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "shows locations with correct data wben the new locations layout feature toggle is disabled" do |
|
|
|
|
|
|
|
allow(FeatureToggle).to receive(:new_locations_table_layout_enabled?).and_return(false) |
|
|
|
|
|
|
|
get "/schemes/#{scheme.id}/locations" |
|
|
|
|
|
|
|
locations.each do |location| |
|
|
|
|
|
|
|
expect(page).to have_content(location.id) |
|
|
|
|
|
|
|
expect(page).to have_content(location.postcode) |
|
|
|
expect(page).to have_content(location.type_of_unit) |
|
|
|
expect(page).to have_content(location.type_of_unit) |
|
|
|
expect(page).to have_content(location.mobility_type) |
|
|
|
expect(page).to have_content(location.mobility_type) |
|
|
|
expect(page).to have_content(location.location_admin_district) |
|
|
|
expect(page).to have_content(location.location_admin_district) |
|
|
|
expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date)) |
|
|
|
expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date)) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has page heading" do |
|
|
|
it "has page heading" do |
|
|
|
expect(page).to have_content(scheme.service_name) |
|
|
|
expect(page).to have_content(scheme.service_name) |
|
|
|
@ -977,21 +983,27 @@ RSpec.describe LocationsController, type: :request do |
|
|
|
get "/schemes/#{scheme.id}/locations" |
|
|
|
get "/schemes/#{scheme.id}/locations" |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it "shows locations with correct data" do |
|
|
|
it "shows locations with correct data wben the new locations layout feature toggle is enabled" do |
|
|
|
locations.each do |location| |
|
|
|
locations.each do |location| |
|
|
|
expect(page).to have_content(location.id) |
|
|
|
expect(page).to have_content(location.id) |
|
|
|
expect(page).to have_content(location.postcode) |
|
|
|
expect(page).to have_content(location.postcode) |
|
|
|
if FeatureToggle.new_locations_table_layout_enabled? |
|
|
|
|
|
|
|
expect(page).to have_content(location.name) |
|
|
|
expect(page).to have_content(location.name) |
|
|
|
expect(page).to have_content(location.status) |
|
|
|
expect(page).to have_content(location.status) |
|
|
|
else |
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "shows locations with correct data wben the new locations layout feature toggle is disabled" do |
|
|
|
|
|
|
|
allow(FeatureToggle).to receive(:new_locations_table_layout_enabled?).and_return(false) |
|
|
|
|
|
|
|
get "/schemes/#{scheme.id}/locations" |
|
|
|
|
|
|
|
locations.each do |location| |
|
|
|
|
|
|
|
expect(page).to have_content(location.id) |
|
|
|
|
|
|
|
expect(page).to have_content(location.postcode) |
|
|
|
expect(page).to have_content(location.type_of_unit) |
|
|
|
expect(page).to have_content(location.type_of_unit) |
|
|
|
expect(page).to have_content(location.mobility_type) |
|
|
|
expect(page).to have_content(location.mobility_type) |
|
|
|
expect(page).to have_content(location.location_admin_district) |
|
|
|
expect(page).to have_content(location.location_admin_district) |
|
|
|
expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date)) |
|
|
|
expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date)) |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "has page heading" do |
|
|
|
it "has page heading" do |
|
|
|
expect(page).to have_content(scheme.service_name) |
|
|
|
expect(page).to have_content(scheme.service_name) |
|
|
|
|