Sha256: 30d5fef0bf7e0fefe39081666a0df21058f5d53eb1192f0293900059630d7b90

Contents?: true

Size: 847 Bytes

Versions: 6

Compression:

Stored size: 847 Bytes

Contents

require 'spec_helper'

describe Warden::GitHub::Rails::TestHelpers do
  describe '#github_login' do
    before { allow(self).to receive(:login_as) }

    context 'when no scope is specified' do
      it 'uses the default scope from config to login' do
        allow(Warden::GitHub::Rails).to receive(:default_scope) { :foobar }

        github_login

        expect(self).to have_received(:login_as).with(
          an_instance_of(Warden::GitHub::Rails::TestHelpers::MockUser),
          match(scope: :foobar)
        )
      end
    end

    context 'when a scope is specified' do
      it 'uses that scope to login' do
        github_login(:admin)

        expect(self).to have_received(:login_as).with(
          an_instance_of(Warden::GitHub::Rails::TestHelpers::MockUser),
          match(scope: :admin)
        )
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
warden-github-rails-1.3.0 spec/unit/test_helpers_spec.rb
warden-github-rails-1.2.3 spec/unit/test_helpers_spec.rb
warden-github-rails-1.2.2 spec/unit/test_helpers_spec.rb
warden-github-rails-1.2.1 spec/unit/test_helpers_spec.rb
warden-github-rails-1.2.0 spec/unit/test_helpers_spec.rb
warden-github-rails-1.1.2 spec/unit/test_helpers_spec.rb