Skip to content

Commit 57f0e26

Browse files
committed
Support OmniAuth 2.0.0
1 parent 3242f85 commit 57f0e26

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

omniauth-ldap.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Gem::Specification.new do |gem|
99
gem.homepage = "https://github.com/intridea/omniauth-ldap"
1010
gem.license = "MIT"
1111

12-
gem.add_runtime_dependency 'omniauth', '~> 1.8.1'
12+
gem.add_runtime_dependency 'omniauth', '~> 2.0.0'
1313
gem.add_runtime_dependency 'net-ldap', '~> 0.16'
1414
gem.add_runtime_dependency 'pyu-ruby-sasl', '~> 0.0.3.3'
1515
gem.add_runtime_dependency 'rubyntlm', '~> 0.6.2'

spec/omniauth/strategies/ldap_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,18 @@ class MyLdapProvider < OmniAuth::Strategies::LDAP; end
2727
expect(OmniAuth::Utils.camelize('ldap')).to eq 'LDAP'
2828
end
2929

30-
describe '/auth/ldap' do
30+
describe 'get /auth/ldap' do
3131
before(:each){ get '/auth/ldap' }
3232

33+
it 'should return 404' do
34+
expect(last_response.status).to eq 404
35+
expect(last_response.body).to_not include("<form")
36+
end
37+
end
38+
39+
describe '/auth/ldap' do
40+
before(:each){ post('/auth/ldap', {}) }
41+
3342
it 'should display a form' do
3443
expect(last_response.status).to eq 200
3544
expect(last_response.body).to include("<form")

spec/spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
require 'omniauth'
88
require 'omniauth-ldap'
99

10+
OmniAuth.config.request_validation_phase = proc {}
11+
1012
RSpec.configure do |config|
1113
config.include Rack::Test::Methods
1214
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy

0 commit comments

Comments
 (0)