omniauth 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of omniauth might be problematic. Click here for more details.

@@ -3,19 +3,19 @@ require 'spec_helper'
3
3
  describe OmniAuth::FailureEndpoint do
4
4
  subject{ OmniAuth::FailureEndpoint }
5
5
 
6
- context 'development' do
6
+ context "development" do
7
7
  before do
8
8
  @rack_env = ENV['RACK_ENV']
9
9
  ENV['RACK_ENV'] = 'development'
10
10
  end
11
11
 
12
- it 'should raise out the error' do
12
+ it "raises out the error" do
13
13
  expect do
14
14
  subject.call('omniauth.error' => StandardError.new("Blah"))
15
15
  end.to raise_error(StandardError, "Blah")
16
16
  end
17
17
 
18
- it 'should raise out an OmniAuth::Error if no omniauth.error is set' do
18
+ it "raises out an OmniAuth::Error if no omniauth.error is set" do
19
19
  expect{ subject.call('omniauth.error.type' => 'example') }.to raise_error(OmniAuth::Error, "example")
20
20
  end
21
21
 
@@ -24,30 +24,30 @@ describe OmniAuth::FailureEndpoint do
24
24
  end
25
25
  end
26
26
 
27
- context 'non-development' do
27
+ context "non-development" do
28
28
  let(:env){ {'omniauth.error.type' => 'invalid_request',
29
29
  'omniauth.error.strategy' => ExampleStrategy.new({}) } }
30
30
 
31
- it 'should be a redirect' do
31
+ it "is a redirect" do
32
32
  status, head, body = *subject.call(env)
33
- status.should == 302
33
+ expect(status).to eq(302)
34
34
  end
35
35
 
36
- it 'should include the SCRIPT_NAME' do
36
+ it "includes the SCRIPT_NAME" do
37
37
  status, head, body = *subject.call(env.merge('SCRIPT_NAME' => '/random'))
38
- head['Location'].should == '/random/auth/failure?message=invalid_request&strategy=test'
38
+ expect(head['Location']).to eq('/random/auth/failure?message=invalid_request&strategy=test')
39
39
  end
40
40
 
41
- it 'should respect configured path prefix' do
41
+ it "respects the configured path prefix" do
42
42
  OmniAuth.config.stub(:path_prefix => '/boo')
43
43
  status, head, body = *subject.call(env)
44
- head["Location"].should == '/boo/failure?message=invalid_request&strategy=test'
44
+ expect(head["Location"]).to eq('/boo/failure?message=invalid_request&strategy=test')
45
45
  end
46
46
 
47
- it 'should include the origin (escaped) if one is provided' do
47
+ it "includes the origin (escaped) if one is provided" do
48
48
  env.merge! 'omniauth.origin' => '/origin-example'
49
49
  status, head, body = *subject.call(env)
50
- head['Location'].should be_include('&origin=%2Forigin-example')
50
+ expect(head['Location']).to be_include('&origin=%2Forigin-example')
51
51
  end
52
52
  end
53
- end
53
+ end
@@ -1,23 +1,23 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe OmniAuth::Form do
4
- describe '.build' do
5
- it 'should yield the instance when called with a block and argument' do
6
- OmniAuth::Form.build{|f| f.should be_kind_of(OmniAuth::Form)}
4
+ describe ".build" do
5
+ it "yields the instance when called with a block and argument" do
6
+ OmniAuth::Form.build{|f| expect(f).to be_kind_of(OmniAuth::Form)}
7
7
  end
8
8
 
9
- it 'should evaluate in the instance when called with a block and no argument' do
10
- OmniAuth::Form.build{ self.class.should == OmniAuth::Form }
9
+ it "evaluates in the instance when called with a block and no argument" do
10
+ OmniAuth::Form.build{|f| expect(f.class).to eq(OmniAuth::Form)}
11
11
  end
12
12
  end
13
13
 
14
- describe '#initialize' do
15
- it 'the :url option should supply to the form that is built' do
16
- OmniAuth::Form.new(:url => '/awesome').to_html.should be_include("action='/awesome'")
14
+ describe "#initialize" do
15
+ it "sets the form action to the passed :url option" do
16
+ expect(OmniAuth::Form.new(:url => '/awesome').to_html).to be_include("action='/awesome'")
17
17
  end
18
18
 
19
- it 'the :title option should set an H1 tag' do
20
- OmniAuth::Form.new(:title => 'Something Cool').to_html.should be_include('<h1>Something Cool</h1>')
19
+ it "sets an H1 tag from the passed :title option" do
20
+ expect(OmniAuth::Form.new(:title => 'Something Cool').to_html).to be_include('<h1>Something Cool</h1>')
21
21
  end
22
22
  end
23
23
  end
@@ -7,45 +7,45 @@ describe OmniAuth::Strategies::Developer do
7
7
  b.run lambda{|env| [200, {}, ['Not Found']]}
8
8
  end.to_app }
9
9
 
10
- context 'request phase' do
10
+ context "request phase" do
11
11
  before(:each){ get '/auth/developer' }
12
12
 
13
- it 'should display a form' do
14
- last_response.status.should == 200
15
- last_response.body.should be_include("<form")
13
+ it "displays a form" do
14
+ expect(last_response.status).to eq(200)
15
+ expect(last_response.body).to be_include("<form")
16
16
  end
17
17
 
18
- it 'should have the callback as the action for the form' do
19
- last_response.body.should be_include("action='/auth/developer/callback'")
18
+ it "has the callback as the action for the form" do
19
+ expect(last_response.body).to be_include("action='/auth/developer/callback'")
20
20
  end
21
21
 
22
- it 'should have a text field for each of the fields' do
23
- last_response.body.scan('<input').size.should == 2
22
+ it "has a text field for each of the fields" do
23
+ expect(last_response.body.scan('<input').size).to eq(2)
24
24
  end
25
25
  end
26
26
 
27
- context 'callback phase' do
27
+ context "callback phase" do
28
28
  let(:auth_hash){ last_request.env['omniauth.auth'] }
29
29
 
30
- context 'with default options' do
30
+ context "with default options" do
31
31
  before do
32
32
  post '/auth/developer/callback', :name => 'Example User', :email => 'user@example.com'
33
33
  end
34
34
 
35
- it 'should set the name in the auth hash' do
36
- auth_hash.info.name.should == 'Example User'
35
+ it "sets the name in the auth hash" do
36
+ expect(auth_hash.info.name).to eq('Example User')
37
37
  end
38
38
 
39
- it 'should set the email in the auth hash' do
40
- auth_hash.info.email.should == 'user@example.com'
39
+ it "sets the email in the auth hash" do
40
+ expect(auth_hash.info.email).to eq('user@example.com')
41
41
  end
42
42
 
43
- it 'should set the uid to the email' do
44
- auth_hash.uid.should == 'user@example.com'
43
+ it "sets the uid to the email" do
44
+ expect(auth_hash.uid).to eq('user@example.com')
45
45
  end
46
46
  end
47
47
 
48
- context 'with custom options' do
48
+ context "with custom options" do
49
49
  let(:app){ Rack::Builder.new do |b|
50
50
  b.use Rack::Session::Cookie
51
51
  b.use OmniAuth::Strategies::Developer, :fields => [:first_name, :last_name], :uid_field => :last_name
@@ -57,12 +57,12 @@ describe OmniAuth::Strategies::Developer do
57
57
  post '/auth/developer/callback', :first_name => 'Example', :last_name => 'User'
58
58
  end
59
59
 
60
- it 'should set info fields properly' do
61
- auth_hash.info.name.should == 'Example User'
60
+ it "sets info fields properly" do
61
+ expect(auth_hash.info.name).to eq('Example User')
62
62
  end
63
63
 
64
- it 'should set the uid properly' do
65
- auth_hash.uid.should == 'User'
64
+ it "sets the uid properly" do
65
+ expect(auth_hash.uid).to eq('User')
66
66
  end
67
67
  end
68
68
  end
@@ -13,8 +13,8 @@ describe OmniAuth::Strategy do
13
13
  let(:app){ lambda{|env| [404, {}, ['Awesome']]}}
14
14
  let(:fresh_strategy){ c = Class.new; c.send :include, OmniAuth::Strategy; c}
15
15
 
16
- describe '.default_options' do
17
- it 'should be inherited from a parent class' do
16
+ describe ".default_options" do
17
+ it "is inherited from a parent class" do
18
18
  superklass = Class.new
19
19
  superklass.send :include, OmniAuth::Strategy
20
20
  superklass.configure do |c|
@@ -22,104 +22,110 @@ describe OmniAuth::Strategy do
22
22
  end
23
23
 
24
24
  klass = Class.new(superklass)
25
- klass.default_options.foo.should == 'bar'
25
+ expect(klass.default_options.foo).to eq('bar')
26
26
  end
27
27
  end
28
28
 
29
- describe '.configure' do
29
+ describe ".configure" do
30
30
  subject { klass = Class.new; klass.send :include, OmniAuth::Strategy; klass }
31
- it 'should take a block and allow for default options setting' do
31
+ it "takes a block and allow for default options setting" do
32
32
  subject.configure do |c|
33
33
  c.wakka = 'doo'
34
34
  end
35
- subject.default_options["wakka"].should == "doo"
35
+ expect(subject.default_options["wakka"]).to eq("doo")
36
36
  end
37
37
 
38
- it 'should take a hash and deep merge it' do
38
+ it "takes a hash and deep merge it" do
39
39
  subject.configure :abc => {:def => 123}
40
40
  subject.configure :abc => {:hgi => 456}
41
- subject.default_options['abc'].should == {'def' => 123, 'hgi' => 456}
41
+ expect(subject.default_options['abc']).to eq({'def' => 123, 'hgi' => 456})
42
42
  end
43
43
  end
44
44
 
45
- describe '#skip_info?' do
46
- it 'should be true if options.skip_info is true' do
47
- ExampleStrategy.new(app, :skip_info => true).should be_skip_info
45
+ describe "#skip_info?" do
46
+ it "is true if options.skip_info is true" do
47
+ expect(ExampleStrategy.new(app, :skip_info => true)).to be_skip_info
48
48
  end
49
49
 
50
- it 'should be false if options.skip_info is false' do
51
- ExampleStrategy.new(app, :skip_info => false).should_not be_skip_info
50
+ it "is false if options.skip_info is false" do
51
+ expect(ExampleStrategy.new(app, :skip_info => false)).not_to be_skip_info
52
52
  end
53
53
 
54
- it 'should be false by default' do
55
- ExampleStrategy.new(app).should_not be_skip_info
54
+ it "is false by default" do
55
+ expect(ExampleStrategy.new(app)).not_to be_skip_info
56
56
  end
57
57
 
58
- it 'should be true if options.skip_info is a callable that evaluates to truthy' do
58
+ it "is true if options.skip_info is a callable that evaluates to truthy" do
59
59
  instance = ExampleStrategy.new(app, :skip_info => lambda{|uid| uid})
60
60
  instance.should_receive(:uid).and_return(true)
61
- instance.should be_skip_info
61
+ expect(instance).to be_skip_info
62
62
  end
63
63
  end
64
64
 
65
- describe '.option' do
65
+ describe ".option" do
66
66
  subject { klass = Class.new; klass.send :include, OmniAuth::Strategy; klass }
67
- it 'should set a default value' do
67
+ it "sets a default value" do
68
68
  subject.option :abc, 123
69
- subject.default_options.abc.should == 123
69
+ expect(subject.default_options.abc).to eq(123)
70
70
  end
71
71
 
72
- it 'should set the default value to nil if none is provided' do
72
+ it "sets the default value to nil if none is provided" do
73
73
  subject.option :abc
74
- subject.default_options.abc.should be_nil
74
+ expect(subject.default_options.abc).to be_nil
75
75
  end
76
76
  end
77
77
 
78
- describe '.args' do
78
+ describe ".args" do
79
79
  subject{ c = Class.new; c.send :include, OmniAuth::Strategy; c }
80
- it 'should set args to the specified argument if there is one' do
80
+ it "sets args to the specified argument if there is one" do
81
81
  subject.args [:abc, :def]
82
- subject.args.should == [:abc, :def]
82
+ expect(subject.args).to eq([:abc, :def])
83
83
  end
84
84
 
85
- it 'should be inheritable' do
85
+ it "is inheritable" do
86
86
  subject.args [:abc, :def]
87
87
  c = Class.new(subject)
88
- c.args.should == [:abc, :def]
88
+ expect(c.args).to eq([:abc, :def])
89
89
  end
90
90
  end
91
91
 
92
- context 'fetcher procs' do
92
+ context "fetcher procs" do
93
93
  subject{ fresh_strategy }
94
94
  %w(uid info credentials extra).each do |fetcher|
95
- it ".#{fetcher} should be able to set and retrieve a proc" do
96
- proc = lambda{ "Hello" }
97
- subject.send(fetcher, &proc)
98
- subject.send(fetcher).should == proc
95
+ describe ".#{fetcher}" do
96
+ it "sets and retrieve a proc" do
97
+ proc = lambda{ "Hello" }
98
+ subject.send(fetcher, &proc)
99
+ expect(subject.send(fetcher)).to eq(proc)
100
+ end
99
101
  end
100
102
  end
101
103
  end
102
104
 
103
- context 'fetcher stacks' do
105
+ context "fetcher stacks" do
104
106
  subject{ fresh_strategy }
105
107
  %w(uid info credentials extra).each do |fetcher|
106
- it ".#{fetcher}_stack should be an array of called ancestral procs" do
107
- fetchy = Proc.new{ "Hello" }
108
- subject.send(fetcher, &fetchy)
109
- subject.send("#{fetcher}_stack", subject.new(app)).should == ["Hello"]
108
+ describe ".#{fetcher}_stack" do
109
+ it "is an array of called ancestral procs" do
110
+ fetchy = Proc.new{ "Hello" }
111
+ subject.send(fetcher, &fetchy)
112
+ expect(subject.send("#{fetcher}_stack", subject.new(app))).to eq(["Hello"])
113
+ end
110
114
  end
111
115
  end
112
116
  end
113
117
 
114
118
  %w(request_phase).each do |abstract_method|
115
- it "#{abstract_method} should raise a NotImplementedError" do
116
- strat = Class.new
117
- strat.send :include, OmniAuth::Strategy
118
- lambda{ strat.new(app).send(abstract_method) }.should raise_error(NotImplementedError)
119
+ context "#{abstract_method}" do
120
+ it "raises a NotImplementedError" do
121
+ strat = Class.new
122
+ strat.send :include, OmniAuth::Strategy
123
+ expect{strat.new(app).send(abstract_method) }.to raise_error(NotImplementedError)
124
+ end
119
125
  end
120
126
  end
121
127
 
122
- describe '#auth_hash' do
128
+ describe "#auth_hash" do
123
129
  subject do
124
130
  klass = Class.new
125
131
  klass.send :include, OmniAuth::Strategy
@@ -128,316 +134,318 @@ describe OmniAuth::Strategy do
128
134
  end
129
135
  let(:instance){ subject.new(app) }
130
136
 
131
- it 'should call through to uid and info' do
137
+ it "calls through to uid and info" do
132
138
  instance.should_receive :uid
133
139
  instance.should_receive :info
134
140
  instance.auth_hash
135
141
  end
136
142
 
137
- it 'should return an AuthHash' do
143
+ it "returns an AuthHash" do
138
144
  instance.stub!(:uid).and_return('123')
139
145
  instance.stub!(:info).and_return(:name => 'Hal Awesome')
140
146
  hash = instance.auth_hash
141
- hash.should be_kind_of(OmniAuth::AuthHash)
142
- hash.uid.should == '123'
143
- hash.info.name.should == 'Hal Awesome'
147
+ expect(hash).to be_kind_of(OmniAuth::AuthHash)
148
+ expect(hash.uid).to eq('123')
149
+ expect(hash.info.name).to eq('Hal Awesome')
144
150
  end
145
151
  end
146
152
 
147
- describe '#initialize' do
148
- context 'options extraction' do
149
- it 'should be the last argument if the last argument is a Hash' do
150
- ExampleStrategy.new(app, :abc => 123).options[:abc].should == 123
153
+ describe "#initialize" do
154
+ context "options extraction" do
155
+ it "is the last argument if the last argument is a Hash" do
156
+ expect(ExampleStrategy.new(app, :abc => 123).options[:abc]).to eq(123)
151
157
  end
152
158
 
153
- it 'should be the default options if any are provided' do
159
+ it "is the default options if any are provided" do
154
160
  ExampleStrategy.stub!(:default_options).and_return(OmniAuth::Strategy::Options.new(:abc => 123))
155
- ExampleStrategy.new(app).options.abc.should == 123
161
+ expect(ExampleStrategy.new(app).options.abc).to eq(123)
156
162
  end
157
163
  end
158
164
 
159
- context 'custom args' do
165
+ context "custom args" do
160
166
  subject{ c = Class.new; c.send :include, OmniAuth::Strategy; c }
161
- it 'should set options based on the arguments if they are supplied' do
167
+ it "sets options based on the arguments if they are supplied" do
162
168
  subject.args [:abc, :def]
163
169
  s = subject.new app, 123, 456
164
- s.options[:abc].should == 123
165
- s.options[:def].should == 456
170
+ expect(s.options[:abc]).to eq(123)
171
+ expect(s.options[:def]).to eq(456)
166
172
  end
167
173
  end
168
174
  end
169
175
 
170
- it '#call should duplicate and call' do
171
- klass = Class.new
172
- klass.send :include, OmniAuth::Strategy
173
- instance = klass.new(app)
174
- instance.should_receive(:dup).and_return(instance)
175
- instance.call({'rack.session' => {}})
176
+ describe "#call" do
177
+ it "duplicates and calls" do
178
+ klass = Class.new
179
+ klass.send :include, OmniAuth::Strategy
180
+ instance = klass.new(app)
181
+ instance.should_receive(:dup).and_return(instance)
182
+ instance.call({'rack.session' => {}})
183
+ end
176
184
  end
177
185
 
178
- describe '#inspect' do
179
- it 'should just be the class name in Ruby inspect format' do
180
- ExampleStrategy.new(app).inspect.should == '#<ExampleStrategy>'
186
+ describe "#inspect" do
187
+ it "returns the class name" do
188
+ expect(ExampleStrategy.new(app).inspect).to eq('#<ExampleStrategy>')
181
189
  end
182
190
  end
183
191
 
184
- describe '#redirect' do
185
- it 'should use javascript if :iframe is true' do
192
+ describe "#redirect" do
193
+ it "uses javascript if :iframe is true" do
186
194
  response = ExampleStrategy.new(app, :iframe => true).redirect("http://abc.com")
187
- response.last.body.first.should be_include("top.location.href")
195
+ expect(response.last.body.first).to be_include("top.location.href")
188
196
  end
189
197
  end
190
198
 
191
- describe '#callback_phase' do
199
+ describe "#callback_phase" do
192
200
  subject{ k = Class.new; k.send :include, OmniAuth::Strategy; k.new(app) }
193
201
 
194
- it 'should set the auth hash' do
202
+ it "sets the auth hash" do
195
203
  env = make_env
196
204
  subject.stub!(:env).and_return(env)
197
205
  subject.stub!(:auth_hash).and_return("AUTH HASH")
198
206
  subject.callback_phase
199
- env['omniauth.auth'].should == "AUTH HASH"
207
+ expect(env['omniauth.auth']).to eq("AUTH HASH")
200
208
  end
201
209
  end
202
210
 
203
- describe '#full_host' do
211
+ describe "#full_host" do
204
212
  let(:strategy){ ExampleStrategy.new(app, {}) }
205
- it 'should not freak out if there is a pipe in the URL' do
213
+ it "remains calm when there is a pipe in the URL" do
206
214
  strategy.call!(make_env('/whatever', 'rack.url_scheme' => 'http', 'SERVER_NAME' => 'facebook.lame', 'QUERY_STRING' => 'code=asofibasf|asoidnasd', 'SCRIPT_NAME' => '', 'SERVER_PORT' => 80))
207
- lambda{ strategy.full_host }.should_not raise_error
215
+ expect{strategy.full_host }.not_to raise_error
208
216
  end
209
217
  end
210
218
 
211
- describe '#uid' do
219
+ describe "#uid" do
212
220
  subject{ fresh_strategy }
213
- it "should be the current class's uid if one exists" do
221
+ it "is the current class's uid if one exists" do
214
222
  subject.uid{ "Hi" }
215
- subject.new(app).uid.should == "Hi"
223
+ expect(subject.new(app).uid).to eq("Hi")
216
224
  end
217
225
 
218
- it "should inherit if it can" do
226
+ it "inherits if it can" do
219
227
  subject.uid{ "Hi" }
220
228
  c = Class.new(subject)
221
- c.new(app).uid.should == "Hi"
229
+ expect(c.new(app).uid).to eq("Hi")
222
230
  end
223
231
  end
224
232
 
225
233
  %w(info credentials extra).each do |fetcher|
226
234
  subject{ fresh_strategy }
227
- it "should be the current class's proc call if one exists" do
235
+ it "is the current class's proc call if one exists" do
228
236
  subject.send(fetcher){ {:abc => 123} }
229
- subject.new(app).send(fetcher).should == {:abc => 123}
237
+ expect(subject.new(app).send(fetcher)).to eq({:abc => 123})
230
238
  end
231
239
 
232
- it 'should inherit by merging with preference for the latest class' do
240
+ it "inherits by merging with preference for the latest class" do
233
241
  subject.send(fetcher){ {:abc => 123, :def => 456} }
234
242
  c = Class.new(subject)
235
243
  c.send(fetcher){ {:abc => 789} }
236
- c.new(app).send(fetcher).should == {:abc => 789, :def => 456}
244
+ expect(c.new(app).send(fetcher)).to eq({:abc => 789, :def => 456})
237
245
  end
238
246
  end
239
247
 
240
- describe '#call' do
248
+ describe "#call" do
241
249
  let(:strategy){ ExampleStrategy.new(app, @options || {}) }
242
250
 
243
- context 'omniauth.origin' do
244
- it 'should be set on the request phase' do
245
- lambda{ strategy.call(make_env('/auth/test', 'HTTP_REFERER' => 'http://example.com/origin')) }.should raise_error("Request Phase")
246
- strategy.last_env['rack.session']['omniauth.origin'].should == 'http://example.com/origin'
251
+ context "omniauth.origin" do
252
+ it "is set on the request phase" do
253
+ expect{strategy.call(make_env('/auth/test', 'HTTP_REFERER' => 'http://example.com/origin')) }.to raise_error("Request Phase")
254
+ expect(strategy.last_env['rack.session']['omniauth.origin']).to eq('http://example.com/origin')
247
255
  end
248
256
 
249
- it 'should be turned into an env variable on the callback phase' do
250
- lambda{ strategy.call(make_env('/auth/test/callback', 'rack.session' => {'omniauth.origin' => 'http://example.com/origin'})) }.should raise_error("Callback Phase")
251
- strategy.last_env['omniauth.origin'].should == 'http://example.com/origin'
257
+ it "is turned into an env variable on the callback phase" do
258
+ expect{strategy.call(make_env('/auth/test/callback', 'rack.session' => {'omniauth.origin' => 'http://example.com/origin'})) }.to raise_error("Callback Phase")
259
+ expect(strategy.last_env['omniauth.origin']).to eq('http://example.com/origin')
252
260
  end
253
261
 
254
- it 'should set from the params if provided' do
255
- lambda{ strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'origin=/foo')) }.should raise_error('Request Phase')
256
- strategy.last_env['rack.session']['omniauth.origin'].should == '/foo'
262
+ it "sets from the params if provided" do
263
+ expect{strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'origin=/foo')) }.to raise_error('Request Phase')
264
+ expect(strategy.last_env['rack.session']['omniauth.origin']).to eq('/foo')
257
265
  end
258
266
 
259
- it 'should be set on the failure env' do
267
+ it "is set on the failure env" do
260
268
  OmniAuth.config.should_receive(:on_failure).and_return(lambda{|env| env})
261
269
  @options = {:failure => :forced_fail}
262
270
  strategy.call(make_env('/auth/test/callback', 'rack.session' => {'omniauth.origin' => '/awesome'}))
263
271
  end
264
272
 
265
273
  context "with script_name" do
266
- it 'should be set on the request phase, containing full path' do
274
+ it "is set on the request phase, containing full path" do
267
275
  env = {'HTTP_REFERER' => 'http://example.com/sub_uri/origin', 'SCRIPT_NAME' => '/sub_uri' }
268
- lambda{ strategy.call(make_env('/auth/test', env)) }.should raise_error("Request Phase")
269
- strategy.last_env['rack.session']['omniauth.origin'].should == 'http://example.com/sub_uri/origin'
276
+ expect{strategy.call(make_env('/auth/test', env)) }.to raise_error("Request Phase")
277
+ expect(strategy.last_env['rack.session']['omniauth.origin']).to eq('http://example.com/sub_uri/origin')
270
278
  end
271
279
 
272
- it 'should be turned into an env variable on the callback phase, containing full path' do
280
+ it "is turned into an env variable on the callback phase, containing full path" do
273
281
  env = {
274
282
  'rack.session' => {'omniauth.origin' => 'http://example.com/sub_uri/origin'},
275
283
  'SCRIPT_NAME' => '/sub_uri'
276
284
  }
277
285
 
278
- lambda{ strategy.call(make_env('/auth/test/callback', env)) }.should raise_error("Callback Phase")
279
- strategy.last_env['omniauth.origin'].should == 'http://example.com/sub_uri/origin'
286
+ expect{strategy.call(make_env('/auth/test/callback', env)) }.to raise_error("Callback Phase")
287
+ expect(strategy.last_env['omniauth.origin']).to eq('http://example.com/sub_uri/origin')
280
288
  end
281
289
 
282
290
  end
283
291
  end
284
292
 
285
- context 'default paths' do
286
- it 'should use the default request path' do
287
- lambda{ strategy.call(make_env) }.should raise_error("Request Phase")
293
+ context "default paths" do
294
+ it "uses the default request path" do
295
+ expect{strategy.call(make_env) }.to raise_error("Request Phase")
288
296
  end
289
297
 
290
- it 'should be case insensitive on request path' do
291
- lambda{ strategy.call(make_env('/AUTH/Test'))}.should raise_error("Request Phase")
298
+ it "is case insensitive on request path" do
299
+ expect{strategy.call(make_env('/AUTH/Test'))}.to raise_error("Request Phase")
292
300
  end
293
301
 
294
- it 'should be case insensitive on callback path' do
295
- lambda{ strategy.call(make_env('/AUTH/TeSt/CaLlBAck'))}.should raise_error("Callback Phase")
302
+ it "is case insensitive on callback path" do
303
+ expect{strategy.call(make_env('/AUTH/TeSt/CaLlBAck'))}.to raise_error("Callback Phase")
296
304
  end
297
305
 
298
- it 'should use the default callback path' do
299
- lambda{ strategy.call(make_env('/auth/test/callback')) }.should raise_error("Callback Phase")
306
+ it "uses the default callback path" do
307
+ expect{strategy.call(make_env('/auth/test/callback')) }.to raise_error("Callback Phase")
300
308
  end
301
309
 
302
- it 'should strip trailing spaces on request' do
303
- lambda{ strategy.call(make_env('/auth/test/')) }.should raise_error("Request Phase")
310
+ it "strips trailing spaces on request" do
311
+ expect{strategy.call(make_env('/auth/test/')) }.to raise_error("Request Phase")
304
312
  end
305
313
 
306
- it 'should strip trailing spaces on callback' do
307
- lambda{ strategy.call(make_env('/auth/test/callback/')) }.should raise_error("Callback Phase")
314
+ it "strips trailing spaces on callback" do
315
+ expect{strategy.call(make_env('/auth/test/callback/')) }.to raise_error("Callback Phase")
308
316
  end
309
317
 
310
- context 'callback_url' do
311
- it 'uses the default callback_path' do
318
+ context "callback_url" do
319
+ it "uses the default callback_path" do
312
320
  strategy.should_receive(:full_host).and_return('http://example.com')
313
321
 
314
- lambda{ strategy.call(make_env) }.should raise_error("Request Phase")
322
+ expect{strategy.call(make_env) }.to raise_error("Request Phase")
315
323
 
316
- strategy.callback_url.should == 'http://example.com/auth/test/callback'
324
+ expect(strategy.callback_url).to eq('http://example.com/auth/test/callback')
317
325
  end
318
326
 
319
- it 'preserves the query parameters' do
327
+ it "preserves the query parameters" do
320
328
  strategy.stub(:full_host).and_return('http://example.com')
321
329
  begin
322
330
  strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'id=5'))
323
331
  rescue RuntimeError; end
324
- strategy.callback_url.should == 'http://example.com/auth/test/callback?id=5'
332
+ expect(strategy.callback_url).to eq('http://example.com/auth/test/callback?id=5')
325
333
  end
326
334
 
327
- it 'consider script name' do
335
+ it "consider script name" do
328
336
  strategy.stub(:full_host).and_return('http://example.com')
329
337
  begin
330
338
  strategy.call(make_env('/auth/test', 'SCRIPT_NAME' => '/sub_uri'))
331
339
  rescue RuntimeError; end
332
- strategy.callback_url.should == 'http://example.com/sub_uri/auth/test/callback'
340
+ expect(strategy.callback_url).to eq('http://example.com/sub_uri/auth/test/callback')
333
341
  end
334
342
  end
335
343
  end
336
344
 
337
- context ':form option' do
338
- it 'should call through to the supplied form option if one exists' do
345
+ context ":form option" do
346
+ it "calls through to the supplied form option if one exists" do
339
347
  strategy.options.form = lambda{|env| "Called me!"}
340
- strategy.call(make_env('/auth/test')).should == "Called me!"
348
+ expect(strategy.call(make_env('/auth/test'))).to eq("Called me!")
341
349
  end
342
350
 
343
- it 'should call through to the app if :form => true is set as an option' do
351
+ it "calls through to the app if :form => true is set as an option" do
344
352
  strategy.options.form = true
345
- strategy.call(make_env('/auth/test')).should == app.call(make_env('/auth/test'))
353
+ expect(strategy.call(make_env('/auth/test'))).to eq(app.call(make_env('/auth/test')))
346
354
  end
347
355
  end
348
356
 
349
- context 'dynamic paths' do
350
- it 'should run the request phase if the custom request path evaluator is truthy' do
357
+ context "dynamic paths" do
358
+ it "runs the request phase if the custom request path evaluator is truthy" do
351
359
  @options = {:request_path => lambda{|env| true}}
352
- lambda{ strategy.call(make_env('/asoufibasfi')) }.should raise_error("Request Phase")
360
+ expect{strategy.call(make_env('/asoufibasfi')) }.to raise_error("Request Phase")
353
361
  end
354
362
 
355
- it 'should run the callback phase if the custom callback path evaluator is truthy' do
363
+ it "runs the callback phase if the custom callback path evaluator is truthy" do
356
364
  @options = {:callback_path => lambda{|env| true}}
357
- lambda{ strategy.call(make_env('/asoufiasod')) }.should raise_error("Callback Phase")
365
+ expect{strategy.call(make_env('/asoufiasod')) }.to raise_error("Callback Phase")
358
366
  end
359
367
 
360
- it 'should provide a custom callback path if request_path evals to a string' do
368
+ it "provides a custom callback path if request_path evals to a string" do
361
369
  strategy_instance = fresh_strategy.new(nil, :request_path => lambda{|env| "/auth/boo/callback/22" })
362
- strategy_instance.callback_path.should == '/auth/boo/callback/22'
363
- end
370
+ expect(strategy_instance.callback_path).to eq('/auth/boo/callback/22')
371
+ end
364
372
  end
365
373
 
366
- context 'custom paths' do
367
- it 'should use a custom request_path if one is provided' do
374
+ context "custom paths" do
375
+ it "uses a custom request_path if one is provided" do
368
376
  @options = {:request_path => '/awesome'}
369
- lambda{ strategy.call(make_env('/awesome')) }.should raise_error("Request Phase")
377
+ expect{strategy.call(make_env('/awesome')) }.to raise_error("Request Phase")
370
378
  end
371
379
 
372
- it 'should use a custom callback_path if one is provided' do
380
+ it "uses a custom callback_path if one is provided" do
373
381
  @options = {:callback_path => '/radical'}
374
- lambda{ strategy.call(make_env('/radical')) }.should raise_error("Callback Phase")
382
+ expect{strategy.call(make_env('/radical')) }.to raise_error("Callback Phase")
375
383
  end
376
384
 
377
- context 'callback_url' do
378
- it 'uses a custom callback_path if one is provided' do
385
+ context "callback_url" do
386
+ it "uses a custom callback_path if one is provided" do
379
387
  @options = {:callback_path => '/radical'}
380
388
  strategy.should_receive(:full_host).and_return('http://example.com')
381
389
 
382
- lambda{ strategy.call(make_env('/radical')) }.should raise_error("Callback Phase")
390
+ expect{strategy.call(make_env('/radical')) }.to raise_error("Callback Phase")
383
391
 
384
- strategy.callback_url.should == 'http://example.com/radical'
392
+ expect(strategy.callback_url).to eq('http://example.com/radical')
385
393
  end
386
394
 
387
- it 'preserves the query parameters' do
395
+ it "preserves the query parameters" do
388
396
  @options = {:callback_path => '/radical'}
389
397
  strategy.stub(:full_host).and_return('http://example.com')
390
398
  begin
391
399
  strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'id=5'))
392
400
  rescue RuntimeError; end
393
- strategy.callback_url.should == 'http://example.com/radical?id=5'
401
+ expect(strategy.callback_url).to eq('http://example.com/radical?id=5')
394
402
  end
395
403
  end
396
404
  end
397
405
 
398
- context 'custom prefix' do
406
+ context "custom prefix" do
399
407
  before do
400
408
  @options = {:path_prefix => '/wowzers'}
401
409
  end
402
410
 
403
- it 'should use a custom prefix for request' do
404
- lambda{ strategy.call(make_env('/wowzers/test')) }.should raise_error("Request Phase")
411
+ it "uses a custom prefix for request" do
412
+ expect{strategy.call(make_env('/wowzers/test')) }.to raise_error("Request Phase")
405
413
  end
406
414
 
407
- it 'should use a custom prefix for callback' do
408
- lambda{ strategy.call(make_env('/wowzers/test/callback')) }.should raise_error("Callback Phase")
415
+ it "uses a custom prefix for callback" do
416
+ expect{strategy.call(make_env('/wowzers/test/callback')) }.to raise_error("Callback Phase")
409
417
  end
410
418
 
411
- context 'callback_url' do
412
- it 'uses a custom prefix' do
419
+ context "callback_url" do
420
+ it "uses a custom prefix" do
413
421
  strategy.should_receive(:full_host).and_return('http://example.com')
414
422
 
415
- lambda{ strategy.call(make_env('/wowzers/test')) }.should raise_error("Request Phase")
423
+ expect{strategy.call(make_env('/wowzers/test')) }.to raise_error("Request Phase")
416
424
 
417
- strategy.callback_url.should == 'http://example.com/wowzers/test/callback'
425
+ expect(strategy.callback_url).to eq('http://example.com/wowzers/test/callback')
418
426
  end
419
427
 
420
- it 'preserves the query parameters' do
428
+ it "preserves the query parameters" do
421
429
  strategy.stub(:full_host).and_return('http://example.com')
422
430
  begin
423
431
  strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'id=5'))
424
432
  rescue RuntimeError; end
425
- strategy.callback_url.should == 'http://example.com/wowzers/test/callback?id=5'
433
+ expect(strategy.callback_url).to eq('http://example.com/wowzers/test/callback?id=5')
426
434
  end
427
435
  end
428
436
  end
429
437
 
430
- context 'request method restriction' do
438
+ context "request method restriction" do
431
439
  before do
432
440
  OmniAuth.config.allowed_request_methods = [:post]
433
441
  end
434
442
 
435
- it 'should not allow a request method of the wrong type' do
436
- lambda{ strategy.call(make_env)}.should_not raise_error
443
+ it "does not allow a request method of the wrong type" do
444
+ expect{strategy.call(make_env)}.not_to raise_error
437
445
  end
438
446
 
439
- it 'should allow a request method of the correct type' do
440
- lambda{ strategy.call(make_env('/auth/test', 'REQUEST_METHOD' => 'POST'))}.should raise_error("Request Phase")
447
+ it "allows a request method of the correct type" do
448
+ expect{strategy.call(make_env('/auth/test', 'REQUEST_METHOD' => 'POST'))}.to raise_error("Request Phase")
441
449
  end
442
450
 
443
451
  after do
@@ -445,36 +453,36 @@ describe OmniAuth::Strategy do
445
453
  end
446
454
  end
447
455
 
448
- context 'receiving an OPTIONS request' do
456
+ context "receiving an OPTIONS request" do
449
457
  shared_examples_for "an OPTIONS request" do
450
- it 'should respond with 200' do
451
- response[0].should == 200
458
+ it "responds with 200" do
459
+ expect(response[0]).to eq(200)
452
460
  end
453
461
 
454
- it 'should set the Allow header properly' do
455
- response[1]['Allow'].should == "GET, POST"
462
+ it "sets the Allow header properly" do
463
+ expect(response[1]['Allow']).to eq("GET, POST")
456
464
  end
457
465
  end
458
466
 
459
- context 'to the request path' do
467
+ context "to the request path" do
460
468
  let(:response) { strategy.call(make_env('/auth/test', 'REQUEST_METHOD' => 'OPTIONS')) }
461
- it_should_behave_like 'an OPTIONS request'
469
+ it_behaves_like "an OPTIONS request"
462
470
  end
463
471
 
464
- context 'to the request path' do
472
+ context "to the request path" do
465
473
  let(:response) { strategy.call(make_env('/auth/test/callback', 'REQUEST_METHOD' => 'OPTIONS')) }
466
- it_should_behave_like 'an OPTIONS request'
474
+ it_behaves_like "an OPTIONS request"
467
475
  end
468
476
 
469
- context 'to some other path' do
470
- it 'should not short-circuit the request' do
477
+ context "to some other path" do
478
+ it "does not short-circuit the request" do
471
479
  env = make_env('/other', 'REQUEST_METHOD' => 'OPTIONS')
472
- strategy.call(env).should == app.call(env)
480
+ expect(strategy.call(env)).to eq(app.call(env))
473
481
  end
474
482
  end
475
483
  end
476
484
 
477
- context 'test mode' do
485
+ context "test mode" do
478
486
  let(:app) do
479
487
  # In test mode, the underlying app shouldn't be called on request phase.
480
488
  lambda { |env| [404, {"Content-Type" => "text/html"}, []] }
@@ -484,98 +492,98 @@ describe OmniAuth::Strategy do
484
492
  OmniAuth.config.test_mode = true
485
493
  end
486
494
 
487
- it 'should short circuit the request phase entirely' do
495
+ it "short circuits the request phase entirely" do
488
496
  response = strategy.call(make_env)
489
- response[0].should == 302
490
- response[1]['Location'].should == '/auth/test/callback'
497
+ expect(response[0]).to eq(302)
498
+ expect(response[1]['Location']).to eq('/auth/test/callback')
491
499
  end
492
500
 
493
- it 'should be case insensitive on request path' do
494
- strategy.call(make_env('/AUTH/Test'))[0].should == 302
501
+ it "is case insensitive on request path" do
502
+ expect(strategy.call(make_env('/AUTH/Test'))[0]).to eq(302)
495
503
  end
496
504
 
497
- it 'should respect SCRIPT_NAME (a.k.a. BaseURI)' do
505
+ it "respects SCRIPT_NAME (a.k.a. BaseURI)" do
498
506
  response = strategy.call(make_env('/auth/test', 'SCRIPT_NAME' => '/sub_uri'))
499
- response[1]['Location'].should == '/sub_uri/auth/test/callback'
507
+ expect(response[1]['Location']).to eq('/sub_uri/auth/test/callback')
500
508
  end
501
509
 
502
- it 'should redirect on failure' do
510
+ it "redirects on failure" do
503
511
  response = OmniAuth.config.on_failure.call(make_env('/auth/test', 'omniauth.error.type' => 'error'))
504
- response[0].should == 302
505
- response[1]['Location'].should == '/auth/failure?message=error'
512
+ expect(response[0]).to eq(302)
513
+ expect(response[1]['Location']).to eq('/auth/failure?message=error')
506
514
  end
507
515
 
508
- it 'should respect SCRIPT_NAME (a.k.a. BaseURI) on failure' do
516
+ it "respects SCRIPT_NAME (a.k.a. BaseURI) on failure" do
509
517
  response = OmniAuth.config.on_failure.call(make_env('/auth/test', 'SCRIPT_NAME' => '/sub_uri', 'omniauth.error.type' => 'error'))
510
- response[0].should == 302
511
- response[1]['Location'].should == '/sub_uri/auth/failure?message=error'
518
+ expect(response[0]).to eq(302)
519
+ expect(response[1]['Location']).to eq('/sub_uri/auth/failure?message=error')
512
520
  end
513
521
 
514
- it 'should be case insensitive on callback path' do
515
- strategy.call(make_env('/AUTH/TeSt/CaLlBAck')).first.should == strategy.call(make_env('/auth/test/callback')).first
522
+ it "is case insensitive on callback path" do
523
+ expect(strategy.call(make_env('/AUTH/TeSt/CaLlBAck')).first).to eq(strategy.call(make_env('/auth/test/callback')).first)
516
524
  end
517
525
 
518
- it 'should maintain query string parameters' do
526
+ it "maintains query string parameters" do
519
527
  response = strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'cheese=stilton'))
520
- response[1]['Location'].should == '/auth/test/callback?cheese=stilton'
528
+ expect(response[1]['Location']).to eq('/auth/test/callback?cheese=stilton')
521
529
  end
522
530
 
523
- it 'should not short circuit requests outside of authentication' do
524
- strategy.call(make_env('/')).should == app.call(make_env('/'))
531
+ it "does not short circuit requests outside of authentication" do
532
+ expect(strategy.call(make_env('/'))).to eq(app.call(make_env('/')))
525
533
  end
526
534
 
527
- it 'should respond with the default hash if none is set' do
535
+ it "responds with the default hash if none is set" do
528
536
  OmniAuth.config.mock_auth[:test] = nil
529
537
 
530
538
  strategy.call make_env('/auth/test/callback')
531
- strategy.env['omniauth.auth']['uid'].should == '1234'
539
+ expect(strategy.env['omniauth.auth']['uid']).to eq('1234')
532
540
  end
533
541
 
534
- it 'should respond with a provider-specific hash if one is set' do
542
+ it "responds with a provider-specific hash if one is set" do
535
543
  OmniAuth.config.mock_auth[:test] = {
536
544
  'uid' => 'abc'
537
545
  }
538
546
 
539
547
  strategy.call make_env('/auth/test/callback')
540
- strategy.env['omniauth.auth']['uid'].should == 'abc'
548
+ expect(strategy.env['omniauth.auth']['uid']).to eq('abc')
541
549
  end
542
550
 
543
- it 'should simulate login failure if mocked data is set as a symbol' do
551
+ it "simulates login failure if mocked data is set as a symbol" do
544
552
  OmniAuth.config.mock_auth[:test] = :invalid_credentials
545
553
 
546
554
  strategy.call make_env('/auth/test/callback')
547
- strategy.env['omniauth.error.type'].should == :invalid_credentials
555
+ expect(strategy.env['omniauth.error.type']).to eq(:invalid_credentials)
548
556
  end
549
557
 
550
- it 'should set omniauth.origin on the request phase' do
558
+ it "sets omniauth.origin on the request phase" do
551
559
  strategy.call(make_env('/auth/test', 'HTTP_REFERER' => 'http://example.com/origin'))
552
- strategy.env['rack.session']['omniauth.origin'].should == 'http://example.com/origin'
560
+ expect(strategy.env['rack.session']['omniauth.origin']).to eq('http://example.com/origin')
553
561
  end
554
562
 
555
- it 'should set omniauth.origin from the params if provided' do
563
+ it "sets omniauth.origin from the params if provided" do
556
564
  strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'origin=/foo'))
557
- strategy.env['rack.session']['omniauth.origin'].should == '/foo'
565
+ expect(strategy.env['rack.session']['omniauth.origin']).to eq('/foo')
558
566
  end
559
567
 
560
- it 'should turn omniauth.origin into an env variable on the callback phase' do
568
+ it "turns omniauth.origin into an env variable on the callback phase" do
561
569
  OmniAuth.config.mock_auth[:test] = {}
562
570
 
563
571
  strategy.call(make_env('/auth/test/callback', 'rack.session' => {'omniauth.origin' => 'http://example.com/origin'}))
564
- strategy.env['omniauth.origin'].should == 'http://example.com/origin'
572
+ expect(strategy.env['omniauth.origin']).to eq('http://example.com/origin')
565
573
  end
566
574
 
567
- it 'should set omniauth.params on the request phase' do
575
+ it "sets omniauth.params on the request phase" do
568
576
  OmniAuth.config.mock_auth[:test] = {}
569
577
 
570
578
  strategy.call(make_env('/auth/test', 'QUERY_STRING' => 'foo=bar'))
571
- strategy.env['rack.session']['omniauth.params'].should == {'foo' => 'bar'}
579
+ expect(strategy.env['rack.session']['omniauth.params']).to eq({'foo' => 'bar'})
572
580
  end
573
581
 
574
- it 'should turn omniauth.params into an env variable on the callback phase' do
582
+ it "turns omniauth.params into an env variable on the callback phase" do
575
583
  OmniAuth.config.mock_auth[:test] = {}
576
584
 
577
585
  strategy.call(make_env('/auth/test/callback', 'rack.session' => {'omniauth.params' => {'foo' => 'bar'}}))
578
- strategy.env['omniauth.params'].should == {'foo' => 'bar'}
586
+ expect(strategy.env['omniauth.params']).to eq({'foo' => 'bar'})
579
587
  end
580
588
 
581
589
  after do
@@ -583,20 +591,20 @@ describe OmniAuth::Strategy do
583
591
  end
584
592
  end
585
593
 
586
- context 'custom full_host' do
594
+ context "custom full_host" do
587
595
  before do
588
596
  OmniAuth.config.test_mode = true
589
597
  end
590
598
 
591
- it 'should be the string when a string is there' do
599
+ it "is the string when a string is there" do
592
600
  OmniAuth.config.full_host = 'my.host.com'
593
- strategy.full_host.should == 'my.host.com'
601
+ expect(strategy.full_host).to eq('my.host.com')
594
602
  end
595
603
 
596
- it 'should run the proc with the env when it is a proc' do
604
+ it "runs the proc with the env when it is a proc" do
597
605
  OmniAuth.config.full_host = Proc.new{|env| env['HOST']}
598
606
  strategy.call(make_env('/auth/test', 'HOST' => 'my.host.net'))
599
- strategy.full_host.should == 'my.host.net'
607
+ expect(strategy.full_host).to eq('my.host.net')
600
608
  end
601
609
 
602
610
  after do
@@ -605,27 +613,27 @@ describe OmniAuth::Strategy do
605
613
  end
606
614
  end
607
615
 
608
- context 'setup phase' do
616
+ context "setup phase" do
609
617
  before do
610
618
  OmniAuth.config.test_mode = true
611
619
  end
612
620
 
613
- context 'when options[:setup] = true' do
621
+ context "when options[:setup] = true" do
614
622
  let(:strategy){ ExampleStrategy.new(app, :setup => true) }
615
623
  let(:app){lambda{|env| env['omniauth.strategy'].options[:awesome] = 'sauce' if env['PATH_INFO'] == '/auth/test/setup'; [404, {}, 'Awesome'] }}
616
624
 
617
- it 'should call through to /auth/:provider/setup' do
625
+ it "calls through to /auth/:provider/setup" do
618
626
  strategy.call(make_env('/auth/test'))
619
- strategy.options[:awesome].should == 'sauce'
627
+ expect(strategy.options[:awesome]).to eq('sauce')
620
628
  end
621
629
 
622
- it 'should not call through on a non-omniauth endpoint' do
630
+ it "does not call through on a non-omniauth endpoint" do
623
631
  strategy.call(make_env('/somewhere/else'))
624
- strategy.options[:awesome].should_not == 'sauce'
632
+ expect(strategy.options[:awesome]).not_to eq('sauce')
625
633
  end
626
634
  end
627
635
 
628
- context 'when options[:setup] is an app' do
636
+ context "when options[:setup] is an app" do
629
637
  let(:setup_proc) do
630
638
  Proc.new do |env|
631
639
  env['omniauth.strategy'].options[:awesome] = 'sauce'
@@ -634,14 +642,14 @@ describe OmniAuth::Strategy do
634
642
 
635
643
  let(:strategy){ ExampleStrategy.new(app, :setup => setup_proc) }
636
644
 
637
- it 'should not call the app on a non-omniauth endpoint' do
645
+ it "does not call the app on a non-omniauth endpoint" do
638
646
  strategy.call(make_env('/somehwere/else'))
639
- strategy.options[:awesome].should_not == 'sauce'
647
+ expect(strategy.options[:awesome]).not_to eq('sauce')
640
648
  end
641
649
 
642
- it 'should call the rack app' do
650
+ it "calls the rack app" do
643
651
  strategy.call(make_env('/auth/test'))
644
- strategy.options[:awesome].should == 'sauce'
652
+ expect(strategy.options[:awesome]).to eq('sauce')
645
653
  end
646
654
  end
647
655
 
@@ -649,4 +657,4 @@ describe OmniAuth::Strategy do
649
657
  OmniAuth.config.test_mode = false
650
658
  end
651
659
  end
652
- end
660
+ end