Revision f8878229
Added by Partha Aji about 10 years ago
test/katello_test_helper.rb | ||
---|---|---|
user ||= users(:admin)
|
||
user = User.find(user)
|
||
User.current = user
|
||
|
||
User.current.stubs(:remote_id).returns(User.current.login)
|
||
if permissions
|
||
permissions.call(Katello::AuthorizationSupportMethods::UserPermissionsGenerator.new(user))
|
||
end
|
||
... | ... | |
def get_organization(org = nil)
|
||
saved_user = User.current
|
||
User.current = User.find(users(:admin))
|
||
|
||
org = org.nil? ? :empty_organization : org
|
||
organization = Organization.find(taxonomies(org.to_sym))
|
||
organization.setup_label_from_name
|
||
organization.save!
|
||
|
||
User.current = saved_user
|
||
organization
|
||
end
|
||
... | ... | |
|
||
# include the concern again after Organization reloading
|
||
Organization.send :include, Katello::Concerns::OrganizationExtensions
|
||
Organization.class_eval do
|
||
def ensure_not_in_transaction!
|
||
end
|
||
end
|
||
end
|
||
|
||
@@model_service_cache[model] = cached_entry
|
Also available in: Unified diff
Code for Org Create orchestration