Good question. I’m using the “describe” syntax along with
config.infer_spec_type_from_file_location!, so the RSpec DSL determines the
class. From the backtrace, I can see that it’s coming from
ActionDispatch::IntegrationTest.
I moved forward to RSpec 3.9 (from 3.1), and this problem has changed. Now,
instead of complaining about positional arguments, I’m getting
undefined method `edit_account_activation' for
#<RSpec::ExampleGroups::AccountActivationsController::GETEdit:0x00007fb0345841c0>
In other words, it’s not allowing URL helpers at all. So this resolves things
for me (as far as controllers are concerned) — I’ll use the get ‘action’,
params: {…} syntax.
However, I’m seeing the same error in request specs now. That is, “get
edit_account_activation(value)” gives the error
DEPRECATION WARNING: Using positional arguments in integration tests has been
deprecated, favor of keyword arguments, and will be removed in Rails 5.1.
I discovered that If I add an empty params hash to the request then the error
goes away, (e.g. "get edit_account_activation_path(@user.activation_token),
params: {}”).
This feels like I’ve found a work-around for an issue that should not exist. So
I have a feeling that this will come back to bite me at some point in the
future.
> On Nov 30, 2020, at 10:53 AM, [email protected] <[email protected]> wrote:
>
> That doesn't seem to be entirely correct.
>
> Rails 5 does
> https://github.com/rails/rails/blob/5-0-stable/railties/lib/rails/generators/test_unit/controller/templates/functional_test.rb#L4
> generate a test that uses `ActionDispatch::IntegrationTest`, but it depends
> on what your test inherits from.
> Do you inherit yours from `ActionDispatch::IntegrationTest` or
> `ActionController::TestCase`?
>
> `ActionController::TestCase` code is still in Rails 5.0
> https://github.com/rails/rails/blob/5-0-stable/actionpack/lib/action_controller/test_case.rb#L388
> and Rails 5.2
> https://github.com/rails/rails/blob/5-2-stable/actionpack/lib/action_controller/test_case.rb#L394
> and even Rails 6.0
> https://github.com/rails/rails/blob/6-0-stable/actionpack/lib/action_controller/test_case.rb#L394
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "rspec" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <mailto:[email protected]>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rspec/806a8626-4568-4ce8-86ed-2260e2ebbfedn%40googlegroups.com
>
> <https://groups.google.com/d/msgid/rspec/806a8626-4568-4ce8-86ed-2260e2ebbfedn%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rspec/437B754E-2CE9-4E72-86E5-4F4B0FA7B253%40pobox.com.