Skip to content

stub_service_delay calls unknown method #18

@HashNotAdam

Description

@HashNotAdam

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions