What you said makes sense.

I incorrectly said I commented out
include MyEngine::SomeController

when I meant to say commenting out
extend ActiveSupport::Concern

fixes the issue.

The codeabse is here,

The specific Controller Class is here,

The specific Controller Spec test is here,

On Saturday, December 1, 2012 7:11:02 PM UTC-6, Frederick Cheung wrote:

On Dec 1, 7:19 pm, Weston Platter 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,
undefined method `recycle!' for
# ./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)

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/ZV0oMRfctjgJ.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts


Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 7 | next ›
Discussion Overview
grouprubyonrails-talk @
postedDec 1, '12 at 11:19p
activeDec 9, '12 at 4:25p



site design / logo © 2022 Grokbase