File: strategy_macros.rb

package info (click to toggle)
ruby-omniauth 1.3.1-1%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 324 kB
  • sloc: ruby: 1,896; makefile: 3
file content (29 lines) | stat: -rw-r--r-- 794 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module OmniAuth
  module Test
    module StrategyMacros
      def sets_an_auth_hash
        it 'sets an auth hash' do
          expect(last_request.env['omniauth.auth']).to be_kind_of(Hash)
        end
      end

      def sets_provider_to(provider)
        it "sets the provider to #{provider}" do
          expect((last_request.env['omniauth.auth'] || {})['provider']).to eq provider
        end
      end

      def sets_uid_to(uid)
        it "sets the UID to #{uid}" do
          expect((last_request.env['omniauth.auth'] || {})['uid']).to eq uid
        end
      end

      def sets_user_info_to(user_info)
        it "sets the user_info to #{user_info}" do
          expect((last_request.env['omniauth.auth'] || {})['user_info']).to eq user_info
        end
      end
    end
  end
end