|
|
@ -324,7 +324,7 @@ RSpec.describe LocationsController, type: :request do |
|
|
|
context "when signed in as a data coordinator" do |
|
|
|
context "when signed in as a data coordinator" do |
|
|
|
let(:user) { FactoryBot.create(:user, :data_coordinator) } |
|
|
|
let(:user) { FactoryBot.create(:user, :data_coordinator) } |
|
|
|
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:location) { FactoryBot.create(:location, scheme: scheme) } |
|
|
|
let!(:location) { FactoryBot.create(:location, scheme:) } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
sign_in user |
|
|
|
sign_in user |
|
|
@ -349,7 +349,7 @@ RSpec.describe LocationsController, type: :request do |
|
|
|
context "when signed in as a support user" do |
|
|
|
context "when signed in as a support user" do |
|
|
|
let(:user) { FactoryBot.create(:user, :support) } |
|
|
|
let(:user) { FactoryBot.create(:user, :support) } |
|
|
|
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:location) { FactoryBot.create(:location, scheme: scheme) } |
|
|
|
let!(:location) { FactoryBot.create(:location, scheme:) } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
allow(user).to receive(:need_two_factor_authentication?).and_return(false) |
|
|
|
allow(user).to receive(:need_two_factor_authentication?).and_return(false) |
|
|
@ -389,7 +389,7 @@ RSpec.describe LocationsController, type: :request do |
|
|
|
context "when signed in as a data coordinator" do |
|
|
|
context "when signed in as a data coordinator" do |
|
|
|
let(:user) { FactoryBot.create(:user, :data_coordinator) } |
|
|
|
let(:user) { FactoryBot.create(:user, :data_coordinator) } |
|
|
|
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:location) { FactoryBot.create(:location, scheme: scheme) } |
|
|
|
let!(:location) { FactoryBot.create(:location, scheme:) } |
|
|
|
let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "No", postcode: "ZZ1 1ZZ" } } } |
|
|
|
let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "No", postcode: "ZZ1 1ZZ" } } } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
@ -502,7 +502,7 @@ RSpec.describe LocationsController, type: :request do |
|
|
|
context "when signed in as a support user" do |
|
|
|
context "when signed in as a support user" do |
|
|
|
let(:user) { FactoryBot.create(:user, :data_coordinator) } |
|
|
|
let(:user) { FactoryBot.create(:user, :data_coordinator) } |
|
|
|
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:scheme) { FactoryBot.create(:scheme, organisation: user.organisation) } |
|
|
|
let!(:location) { FactoryBot.create(:location, scheme: scheme) } |
|
|
|
let!(:location) { FactoryBot.create(:location, scheme:) } |
|
|
|
let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "No", postcode: "ZZ1 1ZZ" } } } |
|
|
|
let(:params) { { location: { name: "Test", total_units: "5", type_of_unit: "Bungalow", wheelchair_adaptation: "No", add_another_location: "No", postcode: "ZZ1 1ZZ" } } } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|