Sha256: c6cebfbc8b5369fb4ead5a5e7c5f127ed1aa9cb1768a11bf57bd30cff3878ace

Contents?: true

Size: 666 Bytes

Versions: 1

Compression:

Stored size: 666 Bytes

Contents

require 'test_helper'
require 'gds-sso/user'

class TestUser < Test::Unit::TestCase
  def setup
    @auth_hash = {
      'provider' => 'gds',
      'uid' => 'abcde',
      'credentials' => {'token' => 'abcdefg', 'secret' => 'abcdefg'},
      'info' => {'name' => 'Matt Patterson', 'email' => 'matt@alphagov.co.uk'},
      'extra' => {'user' => {'permissions' => [], 'organisations' => []}}
    }
  end

  def test_user_params_creation
    expected = {'uid' => 'abcde', 'name' => 'Matt Patterson', 'email' => 'matt@alphagov.co.uk', "permissions" => [], "organisations" => []}
    assert_equal expected, GDS::SSO::User.user_params_from_auth_hash(@auth_hash)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gds-sso-5.0.0 test/user_test.rb