lib/gds-sso/lint/user_spec.rb in gds-sso-10.0.0 vs lib/gds-sso/lint/user_spec.rb in gds-sso-10.0.1
- old
+ new
@@ -1,7 +1,7 @@
RSpec.shared_examples "a gds-sso user class" do
- subject { described_class.new }
+ subject { described_class.new(:uid => '12345') }
it "implements #where" do
expect(described_class).to respond_to(:where)
result = described_class.where(uid: '123')
@@ -14,11 +14,12 @@
subject.update_attribute(:remotely_signed_out, true)
expect(subject).to be_remotely_signed_out
end
it "implements #update_attributes" do
- expect(subject).to respond_to(:update_attributes)
+ subject.update_attributes(email: "ab@c.com")
+ expect(subject.email).to eq("ab@c.com")
end
it "implements #create!" do
expect(described_class).to respond_to(:create!)
end
@@ -42,9 +43,10 @@
}
}
user = described_class.find_for_gds_oauth(auth_hash)
expect(user).to be_an_instance_of(described_class)
+ expect(user.uid).to eq('12345')
expect(user.name).to eq("Joe Smith")
expect(user.email).to eq('joe.smith@example.com')
expect(user.permissions).to eq(['signin'])
expect(user.organisation_slug).to eq('cabinet-office')
end