|
|
@ -57,6 +57,12 @@ RSpec.describe Organisation, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when the organisation has not specified which local authorities it operates in" do |
|
|
|
|
|
|
|
it "displays `all`" do |
|
|
|
|
|
|
|
expect(organisation.local_authority_names).to eq(%w[All]) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when the organisation only uses specific rent periods" do |
|
|
|
context "when the organisation only uses specific rent periods" do |
|
|
|
let(:rent_period_mappings) do |
|
|
|
let(:rent_period_mappings) do |
|
|
|
{ "2" => { "value" => "Weekly for 52 weeks" }, "3" => { "value" => "Every 2 weeks" } } |
|
|
|
{ "2" => { "value" => "Weekly for 52 weeks" }, "3" => { "value" => "Every 2 weeks" } } |
|
|
@ -77,6 +83,12 @@ RSpec.describe Organisation, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when the organisation has not specified which rent periods it uses" do |
|
|
|
|
|
|
|
it "displays `all`" do |
|
|
|
|
|
|
|
expect(organisation.rent_period_labels).to eq(%w[All]) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "with case logs" do |
|
|
|
context "with case logs" do |
|
|
|
let(:other_organisation) { FactoryBot.create(:organisation) } |
|
|
|
let(:other_organisation) { FactoryBot.create(:organisation) } |
|
|
|
let!(:owned_case_log) do |
|
|
|
let!(:owned_case_log) do |
|
|
|