|
|
|
@ -1602,8 +1602,7 @@ RSpec.describe LettingsLog, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when there are no existing relationships" do |
|
|
|
context "when there are no existing relationships" do |
|
|
|
# `relat2` is "P" by default when creating a lettings log from the factory, so we explicitly set it to `nil`. |
|
|
|
let(:log) { create(:lettings_log, :in_progress, hhmemb: 6, details_known_2: 0, details_known_3: 0, details_known_4: 0, details_known_5: 0, details_known_6: 0, relat2: nil, relat3: "X", relat4: "X", relat5: "R") } |
|
|
|
let(:log) { create(:lettings_log, :completed, hhmemb: 6, relat2: nil, relat3: "X", relat4: "X", relat5: "R") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when a new relationship is added" do |
|
|
|
context "when a new relationship is added" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
@ -1624,7 +1623,7 @@ RSpec.describe LettingsLog, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when there is an existing relationship" do |
|
|
|
context "when there is an existing relationship" do |
|
|
|
let(:log) { create(:lettings_log, :completed, hhmemb: 6, relat2: "X", relat3: "P", relat4: "R", relat5: "X") } |
|
|
|
let(:log) { create(:lettings_log, :in_progress, hhmemb: 6, details_known_2: 0, details_known_3: 0, details_known_4: 0, details_known_5: 0, details_known_6: 0, relat2: "X", relat3: "P", relat4: "R", relat5: "X") } |
|
|
|
|
|
|
|
|
|
|
|
context "when a new relationship is added" do |
|
|
|
context "when a new relationship is added" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
@ -1662,7 +1661,7 @@ RSpec.describe LettingsLog, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when more than one relationship is set" do |
|
|
|
context "when more than one relationship is set" do |
|
|
|
let(:log) { create(:lettings_log, :completed, relat2: "X", relat3: "X", relat4: "R", relat5: "X") } |
|
|
|
let(:log) { create(:lettings_log, :in_progress, hhmemb: 6, details_known_2: 0, details_known_3: 0, details_known_4: 0, details_known_5: 0, details_known_6: 0, relat2: "X", relat3: "X", relat4: "R", relat5: "X") } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
log.relat2 = "P" |
|
|
|
log.relat2 = "P" |
|
|
|
@ -1694,8 +1693,7 @@ RSpec.describe LettingsLog, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when there are no existing relationships" do |
|
|
|
context "when there are no existing relationships" do |
|
|
|
# `relat2` is "P" by default when creating a lettings log from the factory, so we explicitly set it to `nil`. |
|
|
|
let(:log) { create(:lettings_log, :in_progress, hhmemb: 6, details_known_2: 0, details_known_3: 0, details_known_4: 0, details_known_5: 0, details_known_6: 0, relat3: "X", relat4: "X", relat5: "R") } |
|
|
|
let(:log) { create(:lettings_log, :completed, hhmemb: 6, relat2: nil, relat3: "X", relat4: "X", relat5: "R") } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "when a new relationship is added" do |
|
|
|
context "when a new relationship is added" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
@ -1761,7 +1759,7 @@ RSpec.describe LettingsLog, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when there is an existing relationship" do |
|
|
|
context "when there is an existing relationship" do |
|
|
|
let(:log) { create(:lettings_log, :completed, hhmemb: 6, relat2: "X", relat3: "P", relat4: "R", relat5: "X") } |
|
|
|
let(:log) { create(:lettings_log, :completed, hhmemb: 6, details_known_2: 0, details_known_3: 0, details_known_4: 0, details_known_5: 0, details_known_6: 0, relat2: "X", relat3: "P", relat4: "R", relat5: "X") } |
|
|
|
|
|
|
|
|
|
|
|
context "and a new relationship is added to an earlier person than the existing one" do |
|
|
|
context "and a new relationship is added to an earlier person than the existing one" do |
|
|
|
before do |
|
|
|
before do |
|
|
|
@ -1878,7 +1876,7 @@ RSpec.describe LettingsLog, type: :model do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "when more than one relationship is set" do |
|
|
|
context "when more than one relationship is set" do |
|
|
|
let(:log) { create(:lettings_log, :completed, hhmemb: 6, relat2: "X", relat3: "X", relat4: "R", relat5: "X") } |
|
|
|
let(:log) { create(:lettings_log, :completed, hhmemb: 6, details_known_2: 0, details_known_3: 0, details_known_4: 0, details_known_5: 0, details_known_6: 0, relat2: "X", relat3: "X", relat4: "R", relat5: "X") } |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
log.relat2 = "P" |
|
|
|
log.relat2 = "P" |
|
|
|
|