Project

General

Profile

« Previous | Next » 

Revision a333a273

Added by Stephen Benjamin almost 6 years ago

fixes #23954 - test stubs should return dynflow task

ForemanTask.async_task returns a dynflow task, and tests that stub this
should also return the same class of object. ForemanTask::Task doesn't
have all the same methods as Task::DynflowTask, e.g. get_humanized.

View differences:

test/controllers/api/v2/repositories_controller_test.rb
def test_remove_content
@repository.rpms << @rpm
@controller.expects(:sync_task).with(::Actions::Katello::Repository::RemoveContent,
@repository, [@rpm], sync_capsule: true).once.returns(::ForemanTasks::Task.new)
@repository, [@rpm], sync_capsule: true).once.returns(::ForemanTasks::Task::DynflowTask.new)
put :remove_content, params: { :id => @repository.id, :ids => [@rpm.uuid] }

Also available in: Unified diff