Commit fb028d5aa65be195932aa5f3a0e694465da15dfb
1 parent
8732ba33
Exists in
master
and in
29 other branches
metadata: fix tests
Showing
2 changed files
with
5 additions
and
4 deletions
Show diff stats
plugins/metadata/test/functional/home_controller_test.rb
| @@ -11,8 +11,9 @@ class HomeControllerTest < ActionController::TestCase | @@ -11,8 +11,9 @@ class HomeControllerTest < ActionController::TestCase | ||
| 11 | @request = ActionController::TestRequest.new | 11 | @request = ActionController::TestRequest.new |
| 12 | @response = ActionController::TestResponse.new | 12 | @response = ActionController::TestResponse.new |
| 13 | 13 | ||
| 14 | - Noosfero::Plugin.stubs(:all).returns([MetadataPlugin.name]) | ||
| 15 | - Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([MetadataPlugin.new(@controller)]) | 14 | + @environment = Environment.default |
| 15 | + @environment.enabled_plugins += ['MetadataPlugin'] | ||
| 16 | + @environment.save! | ||
| 16 | end | 17 | end |
| 17 | 18 | ||
| 18 | should 'display meta tags for social media' do | 19 | should 'display meta tags for social media' do |
plugins/metadata/test/functional/manage_products_controller_test.rb
| @@ -16,8 +16,8 @@ class ManageProductsControllerTest < ActionController::TestCase | @@ -16,8 +16,8 @@ class ManageProductsControllerTest < ActionController::TestCase | ||
| 16 | @environment.enable('products_for_enterprises') | 16 | @environment.enable('products_for_enterprises') |
| 17 | login_as :test_user | 17 | login_as :test_user |
| 18 | 18 | ||
| 19 | - Noosfero::Plugin.stubs(:all).returns([MetadataPlugin.name]) | ||
| 20 | - Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([MetadataPlugin.new(@controller)]) | 19 | + @environment.enabled_plugins += ['MetadataPlugin'] |
| 20 | + @environment.save! | ||
| 21 | end | 21 | end |
| 22 | 22 | ||
| 23 | should "not crash on new products" do | 23 | should "not crash on new products" do |