Forum: Ruby on Rails Engines issue: rake test_plugins failing when it shouldn't

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pete Y. (Guest)
on 2006-01-12 06:23
(Received via mailing list)
I create a simple engine with a simple controller:

   class FredController < ApplicationController
     def hello
       render :text => 'Hello, world!'
     end
   end

and I create a simple functional test within the engine:

   class FredControllerTest < Test::Unit::TestCase
     ...
     def test_hello
       get :hello
       assert_response :success
     end
   end

Running 'rake test_plugins' succeeds, and firing up the server and
requesting /fred/hello gives the expected page.

Now, in the project that includes the engine, I override FredController:

   class FredController < ApplicationController
     def goodbye
       render :text => 'Goodbye.'
     end
   end

Requesting /fred/hello still gives the correct page (as it should),
but now 'rake test_plugins' fails with:

   1) Error:
test_hello(FredControllerTest):
ActionController::UnknownAction: No action responded to hello
     ...
     ./vendor/plugins/my_engine/test/functional/
fred_controller_test.rb:16:in `test_hello'

In other words, as soon as I define a controller in the app that is
the same as a controller in the plugin, the engine tests use only the
code from the app and not the code from the plugin. I would have
thought they'd use both (as the running app does), or, at worst, use
only the controller code from the plugin.

Can anyone confirm this issue? Is there some way that I can work
around it?

Cheers,

Pete Y.
James A. (Guest)
on 2006-01-12 10:53
(Received via mailing list)
This is a known issue, directly a result of an update that I made a
few days ago to the engines plugin. Replace your copy of
/vendor/plugins/engines with what you can find at:

  http://opensvn.csie.org/rails_engines/engines/tags/rel_1.0.1

I should have a fixed version later today...

- james
Pete Y. (Guest)
on 2006-01-12 12:40
(Received via mailing list)
James,

Thanks for your answer, but I think the problem is more than a few
days old. It's been happening to my code for a couple of weeks at
least. Replacing the engines plugin with the tagged version suggested
makes no difference.

Cheers,

Pete Y.
This topic is locked and can not be replied to.