Skip to content

Commit fb485bb

Browse files
authored
Merge pull request #89 from fbacall/master
2 parents 3242f85 + c91e841 commit fb485bb

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

lib/omniauth-ldap/adaptor.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ def initialize(configuration={})
6060
:password => @password
6161
}
6262
config[:auth] = @auth
63+
config[:encryption] = method
6364
@connection = Net::LDAP.new(config)
64-
@connection.encryption(method)
6565
end
6666

6767
#:base => "dc=yourcompany, dc=com",

omniauth-ldap.gemspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ 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'
1616
gem.add_development_dependency 'rspec', '~> 3.0'
17-
gem.add_development_dependency 'simplecov'
18-
gem.add_development_dependency 'rack-test'
17+
gem.add_development_dependency 'simplecov', '~> 0.11'
18+
gem.add_development_dependency 'rack-test', '~> 0.6', '>= 0.6.3'
1919

2020
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
2121
gem.files = `git ls-files`.split("\n")

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: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
require 'omniauth'
88
require 'omniauth-ldap'
99

10+
TEST_LOGGER = Logger.new(StringIO.new)
11+
OmniAuth.config.logger = TEST_LOGGER
12+
OmniAuth.config.request_validation_phase = proc {}
13+
1014
RSpec.configure do |config|
1115
config.include Rack::Test::Methods
1216
config.extend OmniAuth::Test::StrategyMacros, :type => :strategy

0 commit comments

Comments
 (0)