Browse Source

more tests fixed

pull/781/head
JG 3 years ago
parent
commit
2149a679ac
  1. 14
      spec/features/schemes_spec.rb

14
spec/features/schemes_spec.rb

@ -1,6 +1,8 @@
require "rails_helper"
require_relative "schemes_helpers"
using RefinementTest
RSpec.describe "Schemes scheme Features" do
include SchemesHelpers
context "when viewing list of schemes" do
@ -203,7 +205,7 @@ RSpec.describe "Schemes scheme Features" do
it "shows details of those locations" do
locations.each do |location|
expect(page).to have_content(location.id)
expect(page).to have_content(location.postcode)
expect(page).to have_content(location.postcode.formatted_postcode)
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))
@ -476,7 +478,7 @@ RSpec.describe "Schemes scheme Features" do
end
it "displays information about the first created location" do
expect(page).to have_content "AA11AA"
expect(page).to have_content "AA1 1AA"
expect(page).to have_content "Some name"
expect(page).to have_content "5"
expect(page).to have_content "Self-contained house"
@ -493,7 +495,7 @@ RSpec.describe "Schemes scheme Features" do
it "displays information about newly created location" do
click_link "Add a location"
fill_in_and_save_second_location
expect(page).to have_content "XX11XX"
expect(page).to have_content "XX1 1XX"
expect(page).to have_content "Other name"
expect(page).to have_content "Self-contained house"
end
@ -507,13 +509,13 @@ RSpec.describe "Schemes scheme Features" do
end
it "displays changed location" do
click_link "XX11XX"
click_link "XX1 1XX"
fill_in "Postcode", with: "ZZ1 1ZZ"
choose "location-mobility-type-wheelchair-user-standard-field"
click_button "Save and continue"
expect(page).to have_content "Locations"
expect(page).to have_content "#{scheme.locations.count} location"
expect(page).to have_content "ZZ11ZZ"
expect(page).to have_content "ZZ1 1ZZ"
end
end
@ -723,7 +725,7 @@ RSpec.describe "Schemes scheme Features" do
context "when I click to change location name" do
before do
click_link(location.postcode)
click_link(location.postcode.formatted_postcode)
end
it "shows available fields to edit" do

Loading…
Cancel
Save