Class: ControllerLoadingTest

Inherits:
ActionController::TestCase
  • Object
show all
Defined in:
vendor/plugins/engines/test/functional/controller_loading_test.rb

Instance Method Summary

Instance Method Details

- (Object) setup



11
12
13
14
# File 'vendor/plugins/engines/test/functional/controller_loading_test.rb', line 11

def setup
  @request    = ActionController::TestRequest.new
  @response   = ActionController::TestResponse.new
end

- (Object) test_WITH_an_action_defined_in_both_app_and_plugin_IT_should_use_the_one_in_app

app takes precedence over plugins



30
31
32
33
# File 'vendor/plugins/engines/test/functional/controller_loading_test.rb', line 30

def test_WITH_an_action_defined_in_both_app_and_plugin_IT_should_use_the_one_in_app
  get_action_on_controller :an_action, :app_and_plugin
  assert_response_body 'rendered in AppAndPluginController#an_action (from app)'
end

- (Object) test_WITH_an_action_defined_in_namespaced_controllers_in_both_app_and_plugin_IT_should_use_the_one_in_app



35
36
37
38
# File 'vendor/plugins/engines/test/functional/controller_loading_test.rb', line 35

def test_WITH_an_action_defined_in_namespaced_controllers_in_both_app_and_plugin_IT_should_use_the_one_in_app
  get_action_on_controller :an_action, :app_and_plugin, :namespace
  assert_response_body 'rendered in Namespace::AppAndPluginController#an_action (from app)'
end

- (Object) test_WITH_an_action_defined_in_two_namespaced_plugin_controllers_IT_should_use_the_latter_of_both



47
48
49
50
# File 'vendor/plugins/engines/test/functional/controller_loading_test.rb', line 47

def test_WITH_an_action_defined_in_two_namespaced_plugin_controllers_IT_should_use_the_latter_of_both
  get_action_on_controller :an_action, :shared_plugin, :namespace
  assert_response_body 'rendered in Namespace::SharedPluginController#an_action (from beta_plugin)'
end

- (Object) test_WITH_an_action_defined_in_two_plugin_controllers_IT_should_use_the_latter_of_both

subsequently loaded plugins take precendence over previously loaded plugins



42
43
44
45
# File 'vendor/plugins/engines/test/functional/controller_loading_test.rb', line 42

def test_WITH_an_action_defined_in_two_plugin_controllers_IT_should_use_the_latter_of_both
  get_action_on_controller :an_action, :shared_plugin
  assert_response_body 'rendered in SharedPluginController#an_action (from beta_plugin)'
end

- (Object) test_WITH_an_action_defined_only_in_a_namespaced_plugin_controller_IT_should_use_this_action



23
24
25
26
# File 'vendor/plugins/engines/test/functional/controller_loading_test.rb', line 23

def test_WITH_an_action_defined_only_in_a_namespaced_plugin_controller_IT_should_use_this_action
  get_action_on_controller :an_action, :alpha_plugin, :namespace
  assert_response_body 'rendered in Namespace::AlphaPluginController#an_action'
end

- (Object) test_WITH_an_action_defined_only_in_a_plugin_IT_should_use_this_action

plugin controller actions should be found



18
19
20
21
# File 'vendor/plugins/engines/test/functional/controller_loading_test.rb', line 18

def test_WITH_an_action_defined_only_in_a_plugin_IT_should_use_this_action
  get_action_on_controller :an_action, :alpha_plugin
  assert_response_body 'rendered in AlphaPluginController#an_action'
end