Commit d2220530ae289ddb1e974fb34f9819f4436397aa
1 parent
01c2e872
Exists in
staging
and in
42 other branches
ApplicationContoller: remove broken/misplaced tests
Other functionality is already testing this, anyway; in special plugins tests.
Showing
1 changed file
with
0 additions
and
45 deletions
Show diff stats
test/functional/application_controller_test.rb
| ... | ... | @@ -498,51 +498,6 @@ class ApplicationControllerTest < ActionController::TestCase |
| 498 | 498 | |
| 499 | 499 | end |
| 500 | 500 | |
| 501 | - should 'do not duplicate plugin filters' do | |
| 502 | - | |
| 503 | - class FilterPlugin < Noosfero::Plugin | |
| 504 | - def test_controller_filters | |
| 505 | - { :type => 'before_filter', | |
| 506 | - :method_name => 'filter_plugin', | |
| 507 | - :options => {:only => 'some_method'}, | |
| 508 | - :block => lambda {} } | |
| 509 | - end | |
| 510 | - end | |
| 511 | - Noosfero::Plugin.stubs(:all).returns([FilterPlugin.name]) | |
| 512 | - | |
| 513 | - Noosfero::Plugin.load_plugin_filters(FilterPlugin) | |
| 514 | - Noosfero::Plugin::Manager.any_instance.stubs(:enabled_plugins).returns([FilterPlugin.new]) | |
| 515 | - | |
| 516 | - get :index | |
| 517 | - get :index | |
| 518 | - assert_equal 1, @controller.class._process_action_callbacks.select{|c| c.filter == :application_controller_test_filter_plugin_filter_plugin}.count | |
| 519 | - end | |
| 520 | - | |
| 521 | - should 'do not call plugin filter block on a environment that this plugin is not enabled' do | |
| 522 | - | |
| 523 | - class OtherFilterPlugin < Noosfero::Plugin | |
| 524 | - def test_controller_filters | |
| 525 | - { :type => 'before_filter', | |
| 526 | - :method_name => 'filter_plugin', | |
| 527 | - :options => {:only => 'some_method'}, | |
| 528 | - :block => proc {'plugin block called'} } | |
| 529 | - end | |
| 530 | - end | |
| 531 | - Noosfero::Plugin.stubs(:all).returns([OtherFilterPlugin.name]) | |
| 532 | - | |
| 533 | - Noosfero::Plugin.load_plugin_filters(OtherFilterPlugin) | |
| 534 | - environment1 = fast_create(Environment, :name => 'test environment') | |
| 535 | - environment1.enable_plugin(OtherFilterPlugin.name) | |
| 536 | - environment2 = fast_create(Environment, :name => 'other test environment') | |
| 537 | - | |
| 538 | - @controller.stubs(:environment).returns(environment1) | |
| 539 | - get :index | |
| 540 | - assert_equal 'plugin block called', @controller.application_controller_test_other_filter_plugin_filter_plugin | |
| 541 | - | |
| 542 | - @controller.stubs(:environment).returns(environment2) | |
| 543 | - assert_equal nil, @controller.application_controller_test_other_filter_plugin_filter_plugin | |
| 544 | - end | |
| 545 | - | |
| 546 | 501 | should 'display meta tags for social media' do |
| 547 | 502 | get :index |
| 548 | 503 | assert_tag :tag => 'meta', :attributes => { :name => 'twitter:card', :value => 'summary' } | ... | ... |