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

stub_service_delay calls unknown method #18

Open
HashNotAdam opened this issue Oct 30, 2023 · 1 comment
Open

stub_service_delay calls unknown method #18

HashNotAdam opened this issue Oct 30, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@HashNotAdam
Copy link

When using any of the RSpec helper methods for delayed jobs (allow_to_delay_run, allow_to_delay_execute, expect_to_delay_run, expect_not_to_run_delayed, expect_to_not_run_delayed, and expect_to_delay_execute), a NoMethodError is thrown because ActiveInteraction::Extras::Rspec expects the interaction instance to respond to raw_inputs, but it does not. While there is an instance variable, @_interaction_raw_inputs, this is marked as private. Maybe we could inputs?

# Before
opts[:execute] ||= proc do |instance|
  # call original queueing logic, so the argument serialisation is triggered
  delayed_run.run(instance.raw_inputs)
end

# After
opts[:execute] ||= proc do |instance|
  # call original queueing logic, so the argument serialisation is triggered
  delayed_run.run(**instance.inputs.to_h)
end
@antulik antulik added bug Something isn't working help wanted Extra attention is needed labels Nov 15, 2023
@antulik
Copy link
Owner

antulik commented Nov 15, 2023

Personally I don't like the current implementation of Rspec helpers and would like to rewrite them. Contributions are welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants