diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-06-24 04:13:16 +0200 |
| commit | e0a7e0fec760ba12c8067a37e10c96f1f05876e2 (patch) | |
| tree | d0cf745592a46aee4d4913911fd34c7c24515220 /vendor/plugins/exception_notification/test | |
| parent | 6424e10be5a89f175a74c71c55660412a169b8b8 (diff) | |
Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile)
- Updated config structure (application.rb, boot.rb, environment.rb)
- Converted routes to Rails 3 DSL
- Converted named_scope to scope throughout models
- Converted find(:all, :conditions) to where() chains
- Fixed has_many :order to use ordering scope
- Updated session store and secret token configuration
- Fixed exception_notification middleware configuration
- Patched Ruby 2.4 / Rails 3.2 incompatibilities:
- Integer/Float duration arithmetic (ActiveSupport)
- Arel visit_Integer for PostgreSQL adapter
- create_database String/Integer coercion
- ActionController consider_all_requests_local
- Migrated taggings schema for acts-as-taggable-on
- Replaced dynamic_form gem with custom form_error_messages helper
- Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for)
- Fixed admin layout yield
- Updated test suite for Rails 3 APIs
Diffstat (limited to 'vendor/plugins/exception_notification/test')
| -rw-r--r-- | vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb | 61 | ||||
| -rw-r--r-- | vendor/plugins/exception_notification/test/test_helper.rb | 7 |
2 files changed, 0 insertions, 68 deletions
diff --git a/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb b/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb deleted file mode 100644 index dd47637..0000000 --- a/vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | require 'test_helper' | ||
| 2 | require 'exception_notifier_helper' | ||
| 3 | |||
| 4 | class ExceptionNotifierHelperTest < Test::Unit::TestCase | ||
| 5 | |||
| 6 | class ExceptionNotifierHelperIncludeTarget | ||
| 7 | include ExceptionNotifierHelper | ||
| 8 | end | ||
| 9 | |||
| 10 | def setup | ||
| 11 | @helper = ExceptionNotifierHelperIncludeTarget.new | ||
| 12 | end | ||
| 13 | |||
| 14 | # No controller | ||
| 15 | |||
| 16 | def test_should_not_exclude_raw_post_parameters_if_no_controller | ||
| 17 | assert !@helper.exclude_raw_post_parameters? | ||
| 18 | end | ||
| 19 | |||
| 20 | # Controller, no filtering | ||
| 21 | |||
| 22 | class ControllerWithoutFilterParameters; end | ||
| 23 | |||
| 24 | def test_should_not_filter_env_values_for_raw_post_data_keys_if_controller_can_not_filter_parameters | ||
| 25 | stub_controller(ControllerWithoutFilterParameters.new) | ||
| 26 | assert @helper.filter_sensitive_post_data_from_env("RAW_POST_DATA", "secret").include?("secret") | ||
| 27 | end | ||
| 28 | def test_should_not_exclude_raw_post_parameters_if_controller_can_not_filter_parameters | ||
| 29 | stub_controller(ControllerWithoutFilterParameters.new) | ||
| 30 | assert !@helper.exclude_raw_post_parameters? | ||
| 31 | end | ||
| 32 | def test_should_return_params_if_controller_can_not_filter_parameters | ||
| 33 | stub_controller(ControllerWithoutFilterParameters.new) | ||
| 34 | assert_equal :params, @helper.filter_sensitive_post_data_parameters(:params) | ||
| 35 | end | ||
| 36 | |||
| 37 | # Controller with filtering | ||
| 38 | |||
| 39 | class ControllerWithFilterParameters | ||
| 40 | def filter_parameters(params); :filtered end | ||
| 41 | end | ||
| 42 | |||
| 43 | def test_should_filter_env_values_for_raw_post_data_keys_if_controller_can_filter_parameters | ||
| 44 | stub_controller(ControllerWithFilterParameters.new) | ||
| 45 | assert !@helper.filter_sensitive_post_data_from_env("RAW_POST_DATA", "secret").include?("secret") | ||
| 46 | assert @helper.filter_sensitive_post_data_from_env("SOME_OTHER_KEY", "secret").include?("secret") | ||
| 47 | end | ||
| 48 | def test_should_exclude_raw_post_parameters_if_controller_can_filter_parameters | ||
| 49 | stub_controller(ControllerWithFilterParameters.new) | ||
| 50 | assert @helper.exclude_raw_post_parameters? | ||
| 51 | end | ||
| 52 | def test_should_delegate_param_filtering_to_controller_if_controller_can_filter_parameters | ||
| 53 | stub_controller(ControllerWithFilterParameters.new) | ||
| 54 | assert_equal :filtered, @helper.filter_sensitive_post_data_parameters(:params) | ||
| 55 | end | ||
| 56 | |||
| 57 | private | ||
| 58 | def stub_controller(controller) | ||
| 59 | @helper.instance_variable_set(:@controller, controller) | ||
| 60 | end | ||
| 61 | end \ No newline at end of file | ||
diff --git a/vendor/plugins/exception_notification/test/test_helper.rb b/vendor/plugins/exception_notification/test/test_helper.rb deleted file mode 100644 index bbe6fc5..0000000 --- a/vendor/plugins/exception_notification/test/test_helper.rb +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | require 'test/unit' | ||
| 2 | require 'rubygems' | ||
| 3 | require 'active_support' | ||
| 4 | |||
| 5 | $:.unshift File.join(File.dirname(__FILE__), '../lib') | ||
| 6 | |||
| 7 | RAILS_ROOT = '.' unless defined?(RAILS_ROOT) | ||
