spec/unit/user_spec.rb in gds-sso-15.0.0 vs spec/unit/user_spec.rb in gds-sso-15.0.1

- old
+ new

@@ -1,46 +1,45 @@ -require 'spec_helper' -require 'gds-sso/user' -require 'gds-sso/lint/user_spec' +require "spec_helper" +require "gds-sso/user" +require "gds-sso/lint/user_spec" -require 'ostruct' +require "ostruct" describe GDS::SSO::User do before :each do @auth_hash = { - 'provider' => 'gds', - 'uid' => 'abcde', - 'credentials' => {'token' => 'abcdefg', 'secret' => 'abcdefg'}, - 'info' => {'name' => 'Matt Patterson', 'email' => 'matt@alphagov.co.uk'}, - 'extra' => { - 'user' => { - 'permissions' => [], 'organisation_slug' => nil, "organisation_content_id" => nil, 'disabled' => false - } - } + "provider" => "gds", + "uid" => "abcde", + "credentials" => { "token" => "abcdefg", "secret" => "abcdefg" }, + "info" => { "name" => "Matt Patterson", "email" => "matt@alphagov.co.uk" }, + "extra" => { + "user" => { + "permissions" => [], "organisation_slug" => nil, "organisation_content_id" => nil, "disabled" => false + }, + }, } end it "should extract the user params from the oauth hash" do - expected = {'uid' => 'abcde', - 'name' => 'Matt Patterson', - 'email' => 'matt@alphagov.co.uk', - "permissions" => [], - "organisation_slug" => nil, - "organisation_content_id" => nil, - 'disabled' => false, - } + expected = { "uid" => "abcde", + "name" => "Matt Patterson", + "email" => "matt@alphagov.co.uk", + "permissions" => [], + "organisation_slug" => nil, + "organisation_content_id" => nil, + "disabled" => false } expect(GDS::SSO::User.user_params_from_auth_hash(@auth_hash)).to eq(expected) end context "making sure that the lint spec is valid" do class TestUser < OpenStruct include GDS::SSO::User - def self.where(opts) + def self.where(_opts) [] end - def self.create!(options, scope = {}) + def self.create!(options, _scope = {}) new(options) end def update_attribute(key, value) send("#{key}=".to_sym, value)