Commit 4cbb0d6779417677fbdccadabf7b01536e56337e

Authored by Paulo Meireles
1 parent d0fb9e9b

[Mezuro] adding mocks for solr_save into mezuro tests

plugins/mezuro/test/functional/mezuro_plugin_myprofile_controller_test.rb
@@ -28,6 +28,7 @@ class MezuroPluginMyprofileControllerTest < ActionController::TestCase @@ -28,6 +28,7 @@ class MezuroPluginMyprofileControllerTest < ActionController::TestCase
28 Kalibro::Configuration.expects(:all_names).returns([]) 28 Kalibro::Configuration.expects(:all_names).returns([])
29 @content = MezuroPlugin::ConfigurationContent.new(:profile => @profile, :name => @configuration.name) 29 @content = MezuroPlugin::ConfigurationContent.new(:profile => @profile, :name => @configuration.name)
30 @content.expects(:send_configuration_to_service).returns(nil) 30 @content.expects(:send_configuration_to_service).returns(nil)
  31 + @content.stubs(:solr_save)
31 @content.save 32 @content.save
32 33
33 @native_hash = @metric_configuration.to_hash.merge({:configuration_name => @metric_configuration.configuration_name}) 34 @native_hash = @metric_configuration.to_hash.merge({:configuration_name => @metric_configuration.configuration_name})
plugins/mezuro/test/unit/mezuro_plugin/configuration_content_test.rb
@@ -40,6 +40,7 @@ class ConfigurationContentTest < ActiveSupport::TestCase @@ -40,6 +40,7 @@ class ConfigurationContentTest < ActiveSupport::TestCase
40 40
41 should 'send configuration to service after saving' do 41 should 'send configuration to service after saving' do
42 @content.expects :send_configuration_to_service 42 @content.expects :send_configuration_to_service
  43 + @content.stubs(:solr_save)
43 @content.run_callbacks :after_save 44 @content.run_callbacks :after_save
44 end 45 end
45 46