Revision c81a105c
Added by Justin Sherrill about 10 years ago
test/controllers/api/v2/repositories_controller_test.rb | ||
---|---|---|
|
||
def test_create
|
||
product = MiniTest::Mock.new
|
||
product.expect(:add_repo, {}, [
|
||
product.expect(:add_repo, @repository, [
|
||
'Fedora_Repository',
|
||
'Fedora Repository',
|
||
'http://www.google.com',
|
||
... | ... | |
product.expect(:editable?, @product.editable?)
|
||
product.expect(:gpg_key, nil)
|
||
|
||
@controller.expects(:sync_task).with(::Actions::Katello::Repository::Create, @repository).once
|
||
|
||
Product.stub(:find, product) do
|
||
post :create, :name => 'Fedora Repository',
|
||
:product_id => @product.id,
|
||
... | ... | |
product.expect(:gpg_key, key)
|
||
product.expect(:editable?, @product.editable?)
|
||
|
||
product.expect(:add_repo, {}, [
|
||
product.expect(:add_repo, @repository, [
|
||
'Fedora_Repository',
|
||
'Fedora Repository',
|
||
'http://www.google.com',
|
||
... | ... | |
key
|
||
])
|
||
|
||
@controller.expects(:sync_task).with(::Actions::Katello::Repository::Create, @repository).once
|
||
|
||
Product.stub(:find, product) do
|
||
post :create, :name => 'Fedora Repository',
|
||
:product_id => @product.id,
|
Also available in: Unified diff
fixing tests after moving to dynflow for repo creation/deletion