forked from ManageIQ/manageiq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scope User and MiqGroup searches within the current region
- Loading branch information
Showing
4 changed files
with
33 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
describe MiqRequestMixin do | ||
let(:test_class) do | ||
Class.new do | ||
attr_accessor :options, :userid | ||
include MiqRequestMixin | ||
|
||
def initialize | ||
@options = {} | ||
end | ||
end | ||
end | ||
|
||
let(:test_instance) { test_class.new } | ||
|
||
it "#get_user only searches users in the current region" do | ||
user = FactoryGirl.create(:user, :userid => "TestUser") | ||
FactoryGirl.create(:user, :userid => "TestUser", :id => ApplicationRecord.id_in_region(1, ApplicationRecord.my_region_number + 1)) | ||
|
||
test_instance.userid = "TestUser" | ||
expect(test_instance.get_user).to eq(user) | ||
end | ||
end |
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