Skip to content

Commit df990ab

Browse files
author
Dave Sims
committed
Add test for falling back on @connection search when domains are nil
1 parent 1143676 commit df990ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/forest_search_test.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ def setup
1212
@forest_search = GitHub::Ldap::ForestSearch.new(@connection, configuration_naming_context)
1313
end
1414

15-
def test_search
15+
def test_uses_connection_search_when_no_forest_present
16+
# First search returns an empty Hash of domain controllers
17+
@connection.expects(:search).returns({})
18+
# Since the forest is empty, should fall back on the base connection
19+
@connection.expects(:search)
1620
@forest_search.search({})
1721
assert true
1822
end

0 commit comments

Comments
 (0)