Sha256: a2eb1fc1ed4d3342f06c0dbf38a0493eaffd2979509379f3e224c79266953f80
Contents?: true
Size: 917 Bytes
Versions: 13
Compression:
Stored size: 917 Bytes
Contents
require 'test_helper' module Shipit class GithubAuthenticationControllerTest < ActionController::TestCase test ":callback can sign in to github" do auth = OmniAuth::AuthHash.new( credentials: OmniAuth::AuthHash.new( token: 's3cr3t', ), extra: OmniAuth::AuthHash.new( raw_info: OmniAuth::AuthHash.new( id: 44, name: 'Shipit User', email: 'shipit-user@example.com', login: 'shipit-user', avatar_url: 'https://example.com', api_url: 'https://github.com/api/v3/users/shipit-user', ), ), ) @request.env['omniauth.auth'] = auth assert_difference -> { User.count } do get :callback end user = User.find_by_login('shipit-user') assert_equal 's3cr3t', user.github_access_token assert_equal 44, user.github_id end end end
Version data entries
13 entries across 13 versions & 1 rubygems