File tree Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Expand file tree Collapse file tree 4 files changed +18
-5
lines changed Original file line number Diff line number Diff 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",
Original file line number Diff line number Diff 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 " )
Original file line number Diff line number Diff 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" )
Original file line number Diff line number Diff line change 77require 'omniauth'
88require 'omniauth-ldap'
99
10+ TEST_LOGGER = Logger . new ( StringIO . new )
11+ OmniAuth . config . logger = TEST_LOGGER
12+ OmniAuth . config . request_validation_phase = proc { }
13+
1014RSpec . configure do |config |
1115 config . include Rack ::Test ::Methods
1216 config . extend OmniAuth ::Test ::StrategyMacros , :type => :strategy
You can’t perform that action at this time.
0 commit comments