Module: Controller::Testing::Kwargs
- Defined in:
- lib/controller/testing/kwargs.rb,
lib/controller/testing/kwargs/version.rb
Constant Summary collapse
- ERROR_MESSAGE =
'Please use Rails 5 syntax. See: https://github.com/appfolio/controller-testing-kwargs'- VERSION =
"1.0.0"
Class Attribute Summary collapse
-
.on_old ⇒ Object
readonly
Returns the value of attribute on_old.
Class Method Summary collapse
- .deprecate ⇒ Object
- .deprecated? ⇒ Boolean
- .ignore ⇒ Object
- .raise_exception ⇒ Object
- .raise_exception? ⇒ Boolean
Instance Method Summary collapse
Class Attribute Details
.on_old ⇒ Object (readonly)
Returns the value of attribute on_old.
12 13 14 |
# File 'lib/controller/testing/kwargs.rb', line 12 def on_old @on_old end |
Class Method Details
.deprecate ⇒ Object
14 15 16 |
# File 'lib/controller/testing/kwargs.rb', line 14 def deprecate @on_old = :warn end |
.deprecated? ⇒ Boolean
18 19 20 |
# File 'lib/controller/testing/kwargs.rb', line 18 def deprecated? @on_old == :warn end |
.ignore ⇒ Object
22 23 24 |
# File 'lib/controller/testing/kwargs.rb', line 22 def ignore @on_old = :ignore end |
.raise_exception ⇒ Object
26 27 28 |
# File 'lib/controller/testing/kwargs.rb', line 26 def raise_exception @on_old = :raise end |
.raise_exception? ⇒ Boolean
30 31 32 |
# File 'lib/controller/testing/kwargs.rb', line 30 def raise_exception? @on_old == :raise end |
Instance Method Details
#xhr(request_method, action, parameters = nil, *args) ⇒ Object
76 77 78 79 80 |
# File 'lib/controller/testing/kwargs.rb', line 76 def xhr(request_method, action, parameters = nil, *args) raise Exception ERROR_MESSAGE if Controller::Testing::Kwargs.raise_exception? ActiveSupport::Deprecation.warn(ERROR_MESSAGE) if Controller::Testing::Kwargs.deprecated? super(request_method, action, parameters, *args) end |