Controller specs in plugin šŸ˜•


(Alan Tan) #1

Has anyone encountered this voodoo before?

(byebug) xhr :post, :translate
*** ArgumentError Exception: wrong number of arguments (4 for 0)

nil
(byebug) xhr :put, :translate
*** ActionController::ParameterMissing Exception: param is missing or the value is empty: post_id

nil

I have no idea why POST would raise a 4 for 0 argument error. Even after looking at the source for xhr, Iā€™m not sure why this is happening.


(Robin Ward) #2

I have not seen this, but perhaps specs running in plugins are running somewhat differently?


(Alan Tan) #3

I had a let(:post) { Fabricate(:post) } and it was the cause of it. Will need to investigate further. For now I just renamed it. :sadpanda: