lib/gds-sso/lint/user_spec.rb in gds-sso-14.3.0 vs lib/gds-sso/lint/user_spec.rb in gds-sso-15.0.0

- old
+ new

@@ -13,12 +13,12 @@ subject.update_attribute(:remotely_signed_out, true) expect(subject).to be_remotely_signed_out end - it "implements #update_attributes" do - subject.update_attributes(email: "ab@c.com") + it "implements #update!" do + subject.update!(email: "ab@c.com") expect(subject.email).to eq("ab@c.com") end it "implements #create!" do expect(described_class).to respond_to(:create!) @@ -28,22 +28,22 @@ expect(subject).to respond_to(:remotely_signed_out?) end describe "#has_all_permissions?" do it "is false when there are no permissions" do - subject.update_attributes(permissions: nil) + subject.update!(permissions: nil) required_permissions = ["signin"] expect(subject.has_all_permissions?(required_permissions)).to be_falsy end it "is false when it does not have all required permissions" do - subject.update_attributes(permissions: ["signin"]) + subject.update!(permissions: ["signin"]) required_permissions = ["signin", "not_granted_permission_one", "not_granted_permission_two"] expect(subject.has_all_permissions?(required_permissions)).to be false end it "is true when it has all required permissions" do - subject.update_attributes(permissions: ["signin", "internal_app"]) + subject.update!(permissions: ["signin", "internal_app"]) required_permissions = ["signin", "internal_app"] expect(subject.has_all_permissions?(required_permissions)).to be true end end