Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does anyone has the same error? #82

Open
mateoqac opened this issue Aug 7, 2020 · 2 comments
Open

Does anyone has the same error? #82

mateoqac opened this issue Aug 7, 2020 · 2 comments

Comments

@mateoqac
Copy link

mateoqac commented Aug 7, 2020

I'm trying to test some broadcasting (in my case a it will be after a worker does some task) and I always give this error:
Failure/Error: expect { worker.perform(param1,param2) }.to ArgumentError: wrong number of arguments (given 0, expected 1..2)

It does not matter, whatever I write inside the expect I get the same error.

My set up includes:

  • 'rspec-rails', '4.0.1'
  • 'rails', '6.0.3.2'

And of course:

  • 'action-cable-testing'

Also I have required it in my rails_helper after the environment require:

require File.expand_path('../config/environment', __dir__)
require 'action_cable/testing/rspec'

Any ideas or suggestion?
Thanks to everyone in advance!

@palkan
Copy link
Owner

palkan commented Aug 17, 2020

'rspec-rails', '4.0.1'
'rails', '6.0.3.2'

With this setup, you don't need action-cable-testing anymore. Rails 6 and RSpec-Rails 4 has everything included.

I always give this error: ArgumentError: wrong number of arguments (given 0, expected 1..2)

It would be great to see the backtrace (try to disable backtrace filtering, i.e. remove filter_rails_from_backtrace! and filter_gems_from_backtrace from your RSpec configuration). ArgumentError could came from pretty much anywhere.

@jasonfb
Copy link
Contributor

jasonfb commented Jan 18, 2021

"everything is included"

does not mention the fact to access the helpers with Rspec you need to add to rails_helper.rb

  config.include ActionCable::TestHelper

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants