Sha256: 0590449ca2ef913857164c1e76057c98d72c7a4ff55e121228b5880cd55738a5
Contents?: true
Size: 1.41 KB
Versions: 2
Compression:
Stored size: 1.41 KB
Contents
RSpec.shared_examples "a gds-sso user class" do subject { described_class.new } it "implements #where" do expect(described_class).to respond_to(:where) result = described_class.where(uid: '123') expect(result).to respond_to(:first) end it "implements #update_attribute" do expect(subject).to respond_to(:update_attribute) 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) end it "implements #create!" do expect(described_class).to respond_to(:create!) end it "implements #remotely_signed_out?" do expect(subject).to respond_to(:remotely_signed_out?) end specify "the User class and GDS::SSO::User mixin work together" do auth_hash = { 'uid' => '12345', 'info' => { 'name' => 'Joe Smith', 'email' => 'joe.smith@example.com', }, 'extra' => { 'user' => { 'permissions' => ['signin'], 'organisation_slug' => 'cabinet-office', } } } user = described_class.find_for_gds_oauth(auth_hash) expect(user).to be_an_instance_of(described_class) 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 end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
gds-sso-10.0.0 | lib/gds-sso/lint/user_spec.rb |
gds-sso-9.4.0 | lib/gds-sso/lint/user_spec.rb |