Skip to content

Commit 0ca3d0c

Browse files
committed
fixed failing tests, updated to modern rspec syntax, remove an unused runtime dependency
1 parent 1fce18a commit 0ca3d0c

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ source "https://rubygems.org"
22

33
gemspec
44

5+
group :development, :test do
6+
gem 'byebug'
7+
end

omniauth-constantcontact2.gemspec

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Gem::Specification.new do |gem|
1818
gem.add_dependency 'omniauth', '~> 1.0'
1919
gem.add_dependency 'omniauth-oauth2', '~> 1.0'
2020
gem.add_dependency 'multi_json', '~> 1.0'
21-
gem.add_dependency 'multi_xml'
2221

2322
gem.add_development_dependency 'rake'
2423
gem.add_development_dependency 'rspec', '~> 2.8'

spec/omniauth/strategies/constantcontact2_spec.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@
1010

1111
describe '#client' do
1212
it 'should have the correct Constant Contact site' do
13-
subject.client.site.should eq("https://oauth2.constantcontact.com")
13+
expect(subject.client.site).to eq("https://oauth2.constantcontact.com")
1414
end
1515

1616
it 'should have the correct authorization url' do
17-
subject.client.options[:authorize_url].should eq("/oauth2/oauth/siteowner/authorize")
17+
expect(subject.client.options[:authorize_url]).to eq("/oauth2/oauth/siteowner/authorize")
1818
end
1919

2020
it 'should have the correct token url' do
21-
subject.client.options[:token_url].should eq('/oauth2/oauth/token')
21+
expect(subject.client.options[:token_url]).to eq('/oauth2/oauth/token')
2222
end
2323
end
2424

2525
describe '#callback_path' do
2626
it 'should have the correct callback path' do
27-
subject.callback_path.should eq('/auth/constantcontact/callback')
27+
expect(subject.callback_path).to eq('/auth/constantcontact/callback')
2828
end
2929
end
3030
end

spec/spec_helper.rb

+3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
SimpleCov.start
55
require 'rspec'
66
require 'rack/test'
7+
require 'byebug'
78
require 'omniauth'
89
require 'omniauth-constantcontact2'
910

11+
OmniAuth.config.test_mode = true
12+
1013
Dir[File.expand_path('../support/**/*', __FILE__)].each { |f| require f }
1114

1215
RSpec.configure do |config|

spec/support/shared_examples.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@
55
describe '#client' do
66
it 'should be initialized with symbolized client_options' do
77
@options = { :client_options => { 'authorize_url' => 'https://example.com' } }
8-
subject.client.options[:authorize_url].should == 'https://example.com'
8+
expect(subject.client.options[:authorize_url]).to eq('https://example.com')
99
end
1010
end
1111

1212
describe '#authorize_params' do
1313
it 'should include any authorize params passed in the :authorize_params option' do
1414
@options = { :authorize_params => { :foo => 'bar', :baz => 'zip' } }
15-
subject.authorize_params['foo'].should eq('bar')
16-
subject.authorize_params['baz'].should eq('zip')
15+
expect(subject.authorize_params['foo']).to eq('bar')
16+
expect(subject.authorize_params['baz']).to eq('zip')
1717
end
1818

1919
it 'should include top-level options that are marked as :authorize_options' do
2020
@options = { :authorize_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
21-
subject.authorize_params['scope'].should eq('bar')
22-
subject.authorize_params['foo'].should eq('baz')
21+
expect(subject.authorize_params['scope']).to eq('bar')
22+
expect(subject.authorize_params['foo']).to eq('baz')
2323
end
2424
end
2525

2626
describe '#token_params' do
2727
it 'should include any token params passed in the :token_params option' do
2828
@options = { :token_params => { :foo => 'bar', :baz => 'zip' } }
29-
subject.token_params['foo'].should eq('bar')
30-
subject.token_params['baz'].should eq('zip')
29+
expect(subject.token_params['foo']).to eq('bar')
30+
expect(subject.token_params['baz']).to eq('zip')
3131
end
3232

3333
it 'should include top-level options that are marked as :token_options' do
3434
@options = { :token_options => [:scope, :foo], :scope => 'bar', :foo => 'baz' }
35-
subject.token_params['scope'].should eq('bar')
36-
subject.token_params['foo'].should eq('baz')
35+
expect(subject.token_params['scope']).to eq('bar')
36+
expect(subject.token_params['foo']).to eq('baz')
3737
end
3838
end
3939
end

0 commit comments

Comments
 (0)