Browse Source

Merge branch 'CLDC-1854-make-empty-schemes-show-inactive' into CLDC-2140-scheme-typeahead-with-inactive-locations

# Conflicts:
#	spec/helpers/schemes_helper_spec.rb
pull/1455/head
natdeanlewissoftwire 3 years ago
parent
commit
c74553c3d1
  1. 43
      spec/helpers/schemes_helper_spec.rb

43
spec/helpers/schemes_helper_spec.rb

@ -110,6 +110,48 @@ RSpec.describe SchemesHelper do
let(:support_user) { FactoryBot.create(:user, :support) } let(:support_user) { FactoryBot.create(:user, :support) }
let(:coordinator_user) { FactoryBot.create(:user, :data_coordinator) } let(:coordinator_user) { FactoryBot.create(:user, :data_coordinator) }
context "when scheme has no locations" do
it "returns correct display attributes for a support user" do
attributes = [
{ name: "Scheme code", value: "S#{scheme.id}" },
{ name: "Name", value: "Test service_name", edit: true },
{ name: "Confidential information", value: "No", edit: true },
{ name: "Type of scheme", value: "Housing for older people" },
{ name: "Registered under Care Standards Act 2000", value: "Yes – registered care home providing personal care" },
{ name: "Housing stock owned by", value: "Acme LTD Owning", edit: true },
{ name: "Support services provided by", value: "A registered charity or voluntary organisation" },
{ name: "Primary client group", value: "Rough sleepers" },
{ name: "Has another client group", value: "Yes" },
{ name: "Secondary client group", value: "Refugees (permanent)" },
{ name: "Level of support given", value: "High level" },
{ name: "Intended length of stay", value: "Permanent" },
{ name: "Availability", value: "Active from 1 April 2022" },
{ name: "Status", value: status_tag(:incomplete) },
]
expect(display_scheme_attributes(scheme, support_user)).to eq(attributes)
end
it "returns correct display attributes for a coordinator user" do
attributes = [
{ name: "Scheme code", value: "S#{scheme.id}" },
{ name: "Name", value: "Test service_name", edit: true },
{ name: "Confidential information", value: "No", edit: true },
{ name: "Type of scheme", value: "Housing for older people" },
{ name: "Registered under Care Standards Act 2000", value: "Yes – registered care home providing personal care" },
{ name: "Support services provided by", value: "A registered charity or voluntary organisation" },
{ name: "Primary client group", value: "Rough sleepers" },
{ name: "Has another client group", value: "Yes" },
{ name: "Secondary client group", value: "Refugees (permanent)" },
{ name: "Level of support given", value: "High level" },
{ name: "Intended length of stay", value: "Permanent" },
{ name: "Availability", value: "Active from 1 April 2022" },
{ name: "Status", value: status_tag(:incomplete) },
]
expect(display_scheme_attributes(scheme, coordinator_user)).to eq(attributes)
end
end
context "when scheme has a location" do
before do before do
FactoryBot.create(:location, scheme:) FactoryBot.create(:location, scheme:)
end end
@ -276,4 +318,5 @@ RSpec.describe SchemesHelper do
end end
end end
end end
end
end end

Loading…
Cancel
Save