Revision 49be817e
Added by Ivan Necas about 10 years ago
test/actions/katello/user_test.rb | ||
---|---|---|
|
||
require 'katello_test_helper'
|
||
|
||
module Katello
|
||
module ::Actions::Katello::User
|
||
|
||
describe ::Actions::Katello::User do
|
||
class TestBase < ActiveSupport::TestCase
|
||
include Dynflow::Testing
|
||
include Support::Actions::Fixtures
|
||
|
||
describe "Create" do
|
||
let(:action_class) { ::Actions::Katello::User::Create }
|
||
let(:action) { create_action action_class }
|
||
end
|
||
|
||
class CreateTest < TestBase
|
||
let(:action_class) { ::Actions::Katello::User::Create }
|
||
|
||
it 'plans' do
|
||
user = stub('cp',
|
||
remote_id: 'stubbed_user',
|
||
disable_auto_reindex!: true)
|
||
action = create_action action_class
|
||
action.stubs(:action_subject).with(user)
|
||
plan_action(action, user)
|
||
assert_action_planed_with(action,
|
||
::Actions::Pulp::User::Create,
|
||
remote_id: 'stubbed_user')
|
||
assert_action_planed_with(action,
|
||
::Actions::Pulp::User::SetSuperuser,
|
||
remote_id: 'stubbed_user')
|
||
assert_action_planed_with(action, ::Actions::ElasticSearch::Reindex, user)
|
||
end
|
||
it 'plans' do
|
||
user = stub('cp',
|
||
remote_id: 'stubbed_user',
|
||
disable_auto_reindex!: true)
|
||
action.stubs(:action_subject).with(user)
|
||
plan_action(action, user)
|
||
assert_action_planed_with(action, ::Actions::Pulp::User::Create, remote_id: 'stubbed_user')
|
||
assert_action_planed_with(action,
|
||
::Actions::Pulp::User::SetSuperuser, remote_id: 'stubbed_user')
|
||
assert_action_planed_with(action, ::Actions::ElasticSearch::Reindex, user)
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #4584 - use test class instead of describe
Otherwise strange things happen