expect(log.errors[:managing_organisation_id]).toeq(["The organisation must accept the Data Sharing Agreement before it can be selected as the managing organisation."])
it"invalid when changing to another org without a signed Data Protection Confirmation"do
expect{log.managing_organisation=org_without_dpc}.tochange(log,:valid?).from(true).to(false).and(change{log.errors[:managing_organisation_id]}.to(["The organisation must accept the Data Sharing Agreement before it can be selected as the managing organisation."]))
expect(log.errors[:owning_organisation_id]).toeq(["The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."])
it"invalid when changing to another org without a signed Data Protection Confirmation"do
expect{log.owning_organisation=org_without_dpc}.tochange(log,:valid?).from(true).to(false).and(change{log.errors[:owning_organisation_id]}.to(["The organisation must accept the Data Sharing Agreement before it can be selected as the owning organisation."]))