Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
1.0.3 -> 1.0.4 update breaks url_for in tests #42
I believe I have a related problem, but not in the helper.
generates this error:
The controller/route is working, rake routes show the routes correctly, but some tests fail.
@tscolari, are you using https://github.com/apotonick/apotomo or https://github.com/apotonick/cells in your application? Because when I try to reproduce this with a hello world rails app I can't seem to get it to error unless I use apotomo. Anyway, here is a hello world application that uses apotomo and rspec-apotomo to demonstrates this issue:
I'm going post this issue over in the rspec-apotomo issue tracker as well.
EDIT: Here is the issue on the rspec-apotomo issue tracker:
The rspec for the controllers are failing (ActionController::RoutingError), at the same time that the routes exist and the routing specs pass.
Forcing journey to 1.0.3 will make the ActionController::RoutingError go away (the test still fails because of the view, but that's not the point).
@tscolari may I suggest leaving off the nyan cat formatter next time and try and reproduce in an app with as few as dependencies as possible - all you needed to add was RSpec. Anyway your problem is fixed if you specify the path parameters when calling
describe CacheController do describe "GET 'manifest'" do it "returns http success" do get 'manifest', :mode => 'iphone' response.should render_template(:manifest) end end end describe MobileController do describe "GET 'index'" do it "returns http success" do get 'index', :mode => 'web' response.should be_success end end end
@atambo and @keo I suspect your tests with 1.0.3 are lying to you - you're probably getting incorrect urls as in #40 as well. Can you please check and post code that reproduces the error in 1.0.4 and generates a correct url in 1.0.3.
I'm closing this for the moment as I suspect it's a duplicate of #40, however I'll reopen it if someone can post some example code.
referenced this issue
Aug 9, 2012
I'm receiving similar test environment errors as @atambo. I'm not sure the issue is a duplicate of all the linked errors #40, #20, #35, or #41. I don't believe the tests in 1.0.3 are lying to me. I uploaded two apps to github: https://github.com/dsandstrom/journey_103_test and https://github.com/dsandstrom/journey_104_test . Basically they consist of an application helper method and a corresponding test.
In journey 1.0.3, the test passes, in 1.0.4, I receive the error:
The code works in development/production, but not in test. Changing the hash does not have an impact. If I add a proper route like
@dsandstrom If there's no routes then it shouldn't generate anything, it should always raise an error. If there's a matched route (i.e. current request) then it should either eliminate the path parameter