Closed alkrauss48 closed 10 years ago
I had the same problem, and this PR fixed it. Thanks @alkrauss48 !
I'd like to see this too :+1: . I use a catch all route so Ember can use the location api for its own routes.
Hi @frodsan,
I was on that branch of @alkrauss48 and things were fine. I just upgraded to your 0.0.6, and I get the following error:
ArgumentError: Invalid route name, already in use: 'q_unit_rails'
You may have defined two routes with the same name using the `:as` option, or you may be overriding a route already defined by a resource with the same naming. For the latter, you can restrict the routes created with `resources` as explained here:
http://guides.rubyonrails.org/routing.html#restricting-the-routes-created
I have the following at the bottom of my routes.rb:
mount QUnit::Rails::Engine => '/qunit' if Rails.env.development? || Rails.env.test?
match '*unmatched_route', to: 'main#index', via: :get
Is there now a better, supported way to do this?
EDIT, Nevermind, had to name the route something different is all:
mount QUnit::Rails::Engine => '/qunit', as: 'qunit' if Rails.env.development? || Rails.env.test?
Thanks for the report, I think it's because this change: https://github.com/frodsan/qunit-rails/commit/f23146090e19f60d0f50e27e8c6749c5a9127714. I will revert it. Sorry for the trouble.
QUnit is better than Qunit as a namespace, IMO, so you made the right call (back-compat-breaking or not :P)
I like the change you did in your app. I will backport it.
@elsurudo Could you use this branch https://github.com/frodsan/qunit-rails/tree/fix_routes and remove the as: "qunit"
parameter please? Let me know if that works :smile:
Yup, that worked!
What a quick release cycle :P
Thanks!
On Jan 20, 2014, at 8:42 PM, Francesco Rodríguez notifications@github.com wrote:
Thanks, I release 0.0.7 with that fix, please upgrade.
— Reply to this email directly or view it on GitHub.
I have been having issues using qunit while simultaneously using wildcard routes. My app utilizes a necessary route like:
which overrides the default qunit route since that seems to get mounted after this wildcard route. I can prevent this from happening by manually mounting it in my routes like so:
but then it gets remounted in the gem, and the entire rails application complains when I do anything (run tests, list routes, run zeus, etc.) because there are 2 named routes with the same name.
So this little fix will not remount the engine if it was previously mounted in the routes.rb in the rails app, which will allow the engine to get mounted prior to any wildcard routes.