Passing direct parameters to a Controller#method when testing via RSpec

Posted by gmile on Stack Overflow See other posts from Stack Overflow or by gmile
Published on 2010-04-15T16:52:48Z Indexed on 2010/04/16 6:13 UTC
Read the original article Hit count: 217

Normally to pass parameters via in RSpec we do:

params[:my_key] = my_value
get :my_method

Where my_method deals with what it received from params. But in my controller I have a method, which takes args directly i.e.:

def my_method(*args)
  ...
end

How do I call the method with those args from within the test? I've tried get :my_method(args) but Ruby interpreter complains about syntax error.

© Stack Overflow or respective owner

Related posts about rspec

Related posts about ruby-on-rails