Skip to content

Instantly share code, notes, and snippets.

@zjhuntin
Last active April 1, 2016 20:19
Show Gist options
  • Save zjhuntin/ea584a9f50165c6282ed865e2f53c955 to your computer and use it in GitHub Desktop.
Save zjhuntin/ea584a9f50165c6282ed865e2f53c955 to your computer and use it in GitHub Desktop.
def test_create
binding.pry
product = mock
product.responds_like(Product)
product.expects(:add_repo).with(
'Fedora_Repository',
'Fedora Repository',
'http://www.google.com',
'yum',
true,
nil,
nil,
nil
).returns(@repository)
product.expects(:gpg_key).returns(nil)
product.expects(:organization).returns(@organization)
product.expects(:redhat?).returns(false)
assert_sync_task(::Actions::Katello::Repository::Create, @repository, false, true)
post :create, :name => 'Fedora Repository',
:product_id => @product.id,
:url => 'http://www.google.com',
:content_type => 'yum'
assert_response :success
assert_template 'api/v2/repositories/show'
product.find(@product.id)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment