noosfero | ApplicationContoller: remove broken/misplaced tests
Antonio Terceiro
gitlab at gitlab.com
Tue Jan 27 17:07:23 BRST 2015
Antonio Terceiro pushed to refs/heads/master at <a href="https://gitlab.com/noosfero/noosfero">Noosfero / noosfero</a>
Commits:
<a href="https://gitlab.com/noosfero/noosfero/commit/d2220530ae289ddb1e974fb34f9819f4436397aa">d2220530</a> by Antonio Terceiro
ApplicationContoller: remove broken/misplaced tests
Other functionality is already testing this, anyway; in special plugins
tests.
- - - - -
Changes:
=====================================
test/functional/application_controller_test.rb
=====================================
--- a/test/functional/application_controller_test.rb
+++ b/test/functional/application_controller_test.rb
@@ -498,51 +498,6 @@ class ApplicationControllerTest < ActionController::TestCase
end
- should 'do not duplicate plugin filters' do
-
- class FilterPlugin < Noosfero::Plugin
- def test_controller_filters
- { :type => 'before_filter',
- :method_name => 'filter_plugin',
- :options => {:only => 'some_method'},
- :block => lambda {} }
- end
- end
- Noosfero::Plugin.stubs(:all).returns([FilterPlugin.name])
-
- Noosfero::Plugin.load_plugin_filters(FilterPlugin)
- Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([FilterPlugin.new])
-
- get :index
- get :index
- assert_equal 1, @controller.class._process_action_callbacks.select{|c| c.filter == :application_controller_test_filter_plugin_filter_plugin}.count
- end
-
- should 'do not call plugin filter block on a environment that this plugin is not enabled' do
-
- class OtherFilterPlugin < Noosfero::Plugin
- def test_controller_filters
- { :type => 'before_filter',
- :method_name => 'filter_plugin',
- :options => {:only => 'some_method'},
- :block => proc {'plugin block called'} }
- end
- end
- Noosfero::Plugin.stubs(:all).returns([OtherFilterPlugin.name])
-
- Noosfero::Plugin.load_plugin_filters(OtherFilterPlugin)
- environment1 = fast_create(Environment, :name => 'test environment')
- environment1.enable_plugin(OtherFilterPlugin.name)
- environment2 = fast_create(Environment, :name => 'other test environment')
-
- @controller.stubs(:environment).returns(environment1)
- get :index
- assert_equal 'plugin block called', @controller.application_controller_test_other_filter_plugin_filter_plugin
-
- @controller.stubs(:environment).returns(environment2)
- assert_equal nil, @controller.application_controller_test_other_filter_plugin_filter_plugin
- end
-
should 'display meta tags for social media' do
get :index
assert_tag :tag => 'meta', :attributes => { :name => 'twitter:card', :value => 'summary' }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20150127/b8eb4ac3/attachment-0001.html>
More information about the Noosfero-dev
mailing list