|
|
|
@ -2035,6 +2035,17 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
expect(page).to have_content("What client group is this scheme intended for?") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct back link" do |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/details") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "and accessed from check answers" do |
|
|
|
|
it "has correct back link" do |
|
|
|
|
get "/schemes/#{scheme.id}/primary-client-group?referrer=check-answers" |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/check-answers") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when attempting to access primary-client-group scheme page for another organisation" do |
|
|
|
|
before do |
|
|
|
|
get "/schemes/#{another_scheme.id}/primary-client-group" |
|
|
|
@ -2112,6 +2123,17 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
expect(page).to have_content("Does this scheme provide for another client group?") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct back link" do |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/primary-client-group") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "and accessed from check answers" do |
|
|
|
|
it "has correct back link" do |
|
|
|
|
get "/schemes/#{scheme.id}/confirm-secondary-client-group?referrer=check-answers" |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/check-answers") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when attempting to access confirm-secondary-client-group scheme page for another organisation" do |
|
|
|
|
before do |
|
|
|
|
get "/schemes/#{another_scheme.id}/confirm-secondary-client-group" |
|
|
|
@ -2189,6 +2211,24 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
expect(page).to have_content("What is the other client group?") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct back link" do |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/confirm-secondary-client-group") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "and accessed from check answers" do |
|
|
|
|
it "has correct back link" do |
|
|
|
|
get "/schemes/#{scheme.id}/secondary-client-group?referrer=check-answers" |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/check-answers") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "and accessed from has other client group" do |
|
|
|
|
it "has correct back link" do |
|
|
|
|
get "/schemes/#{scheme.id}/secondary-client-group?referrer=has-other-client-group" |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/confirm-secondary-client-group?referrer=check-answers") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when attempting to access secondary-client-group scheme page for another organisation" do |
|
|
|
|
before do |
|
|
|
|
get "/schemes/#{another_scheme.id}/secondary-client-group" |
|
|
|
@ -2258,7 +2298,7 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
|
|
|
|
|
context "when signed in as a data coordinator" do |
|
|
|
|
let(:user) { create(:user, :data_coordinator) } |
|
|
|
|
let(:scheme) { create(:scheme, owning_organisation: user.organisation, confirmed: nil) } |
|
|
|
|
let(:scheme) { create(:scheme, owning_organisation: user.organisation, confirmed: nil, has_other_client_group: "Yes") } |
|
|
|
|
let(:another_scheme) { create(:scheme, confirmed: nil) } |
|
|
|
|
|
|
|
|
|
before do |
|
|
|
@ -2271,6 +2311,27 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
expect(page).to have_content("What support does this scheme provide?") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when scheme has secondary client group" do |
|
|
|
|
it "has correct back link" do |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/secondary-client-group") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when scheme has no secondary client group" do |
|
|
|
|
let(:scheme) { create(:scheme, owning_organisation: user.organisation, confirmed: nil, has_other_client_group: "No") } |
|
|
|
|
|
|
|
|
|
it "has correct back link" do |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/confirm-secondary-client-group") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "and accessed from check answers" do |
|
|
|
|
it "has correct back link" do |
|
|
|
|
get "/schemes/#{scheme.id}/support?referrer=check-answers" |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/check-answers") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when attempting to access secondary-client-group scheme page for another organisation" do |
|
|
|
|
before do |
|
|
|
|
get "/schemes/#{another_scheme.id}/support" |
|
|
|
@ -2433,6 +2494,17 @@ RSpec.describe SchemesController, type: :request do
|
|
|
|
|
expect(page).to have_content("Create a new supported housing scheme") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
it "has correct back link" do |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "and accessed from check answers" do |
|
|
|
|
it "has correct back link" do |
|
|
|
|
get "/schemes/#{scheme.id}/details?referrer=check-answers" |
|
|
|
|
expect(page).to have_link("Back", href: "/schemes/#{scheme.id}/check-answers") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
context "when attempting to access check-answers scheme page for another organisation" do |
|
|
|
|
before do |
|
|
|
|
get "/schemes/#{another_scheme.id}/details" |
|
|
|
|