Skip to content

Instantly share code, notes, and snippets.

@jlsherrill
Created March 13, 2014 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jlsherrill/9528591 to your computer and use it in GitHub Desktop.
Save jlsherrill/9528591 to your computer and use it in GitHub Desktop.
diff --git a/test/controllers/api/v2/content_view_puppet_modules_controller_test.rb b/test/controllers/api/v2/content_view_puppet_modules_controller_test.rb
index bcb799d..2a5978a 100644
--- a/test/controllers/api/v2/content_view_puppet_modules_controller_test.rb
+++ b/test/controllers/api/v2/content_view_puppet_modules_controller_test.rb
@@ -42,6 +42,7 @@ module Katello
@fake_search_service = @controller.load_search_service(Support::SearchService::FakeSearchService.new)
models
permissions
+ ContentViewPuppetModule.any_instance.stubs(:puppet_module).returns(PuppetModule.new)
end
def test_index
diff --git a/test/controllers/api/v2/puppet_modules_controller_test.rb b/test/controllers/api/v2/puppet_modules_controller_test.rb
index dca3711..5e58943 100644
--- a/test/controllers/api/v2/puppet_modules_controller_test.rb
+++ b/test/controllers/api/v2/puppet_modules_controller_test.rb
@@ -15,8 +15,8 @@ require "katello_test_helper"
module Katello
class Api::V2::PuppetModulesControllerTest < ActionController::TestCase
- def before_suite
- models = ["Organization", "KTEnvironment", "PuppetModule", "Repository", "Product", "Provider"]
+ def self.before_suite
+ models = ["Organization", "KTEnvironment", "Repository", "Product", "Provider"]
services = ["Candlepin", "Pulp", "ElasticSearch"]
disable_glue_layers(services, models)
super
@@ -64,7 +64,7 @@ class Api::V2::PuppetModulesControllerTest < ActionController::TestCase
end
def test_show
- PuppetModule.expects(:find).once.returns(mock({:repoids => [@repo.pulp_id]}))
+ PuppetModule.expects(:find).once.returns(PuppetModule.new({:repoids => [@repo.pulp_id]}))
get :show, :repository_id => @repo.id, :id => "abc-123"
assert_response :success
diff --git a/test/glue/elasticsearch/items_test.rb b/test/glue/elasticsearch/items_test.rb
index 43d6175..1ded832 100644
--- a/test/glue/elasticsearch/items_test.rb
+++ b/test/glue/elasticsearch/items_test.rb
@@ -39,6 +39,7 @@ class GlueElasticSearchTest < ActiveSupport::TestCase
@results.expect(:total, 0)
@results.expect(:total, 0)
@results.expect(:results, [])
+ @results.expect(:facets, {})
@FakeClass.stub(:search, @results) do
items, count = @items.retrieve("*")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment