-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
{ | ||
"id": "example.com", | ||
"fullyQualifiedDomainName": "example.com", | ||
"ownerDelegatedRequestToTeam": true, | ||
"ownerDelegatedRequestsToTeam": true, | ||
"autoApprovedGroups": "group1", | ||
"autoApprovedServiceAccounts": "[email protected]" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
require "test_helper" | ||
|
||
class DomainOwnershipServiceTest < ActiveSupport::TestCase | ||
setup do | ||
@subject = Services::DomainOwnershipService.new | ||
end | ||
|
||
test "#get_domain_info fetches from configured api server" do | ||
domain_info = @subject.get_domain_info(domains(:owner_match).fqdn) | ||
assert_not_nil domain_info | ||
assert_equal "group1", domain_info.groups | ||
assert_equal "[email protected]", domain_info.users | ||
assert_equal "example.com", domain_info.fqdn | ||
assert domain_info.group_delegation | ||
end | ||
|
||
test "#get_domain_info returns nil for unmatched fqdn" do | ||
domain_info = @subject.get_domain_info(domains(:group_match).fqdn) | ||
assert_nil domain_info | ||
end | ||
end |