Browse Source

test: re-add tests for locations page when new layout not enabled

pull/987/head
Sam Seed 4 years ago
parent
commit
37b12cff9e
  1. 6
      spec/features/schemes_spec.rb
  2. 12
      spec/requests/locations_controller_spec.rb

6
spec/features/schemes_spec.rb

@ -204,8 +204,14 @@ RSpec.describe "Schemes scheme Features" 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("Active") expect(page).to have_content("Active")
else
expect(page).to have_content(location.units)
expect(page).to have_content(location.type_of_unit)
expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date))
end
end end
end end
end end

12
spec/requests/locations_controller_spec.rb

@ -871,8 +871,15 @@ RSpec.describe LocationsController, type: :request 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
expect(page).to have_content(location.type_of_unit)
expect(page).to have_content(location.mobility_type)
expect(page).to have_content(location.location_admin_district)
expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date))
end
end end
end end
@ -974,8 +981,13 @@ RSpec.describe LocationsController, type: :request 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
expect(page).to have_content(location.type_of_unit)
expect(page).to have_content(location.startdate&.to_formatted_s(:govuk_date))
end
end end
end end

Loading…
Cancel
Save