On Dec 1, 7:19 pm, Weston Platter <
westonplat...@gmail.com> wrote:
>
> But, this breaks my rpsec controller tests because of an undefined
> "recycle" method.
>
> 12) Qe::Admin::QuestionPagesController POST reorder
> Failure/Error: xhr :post, :create,
> NoMethodError:
> undefined method `recycle!' for
> #<Qe::Admin::QuestionPagesController:0x007f80aa1c7528>
> # ./spec/controllers/admin/pages_controller_spec.rb:69:in `block (2
> levels) in <top (required)>'
>
> When I comment out the "include MyEngine::Controller" everything passes.
>
If it's commenting out the include that fixes things, why are you so
sure that it's the extend at fault rather than something else in the
module? Personally I'd be inclined to thing that by including your
module you're accidentally shadowing an existing method on the
controller - if you were to show a minimal example that reproduces the
problem rather than dummy code someone might be able to have a guess
(I suspect the issue may have been lost in translation from your
actual code to the example you gave since the latter isn't valid ruby
(for example you're including a class rather than a module)
Fred
> Why?