-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
acceptance tests not loading helpers in 9.0.0.rc5 #109
Comments
That's odd.. the integration tests are specifically testing for this (rails_delayed_loading_workarounds.feature). 0.8.4 is not compatible with rails 3, which version of rails are you using? |
It gets odder then, Rails 3.0.5, Rspec 2.5.0, Ruby 1.9.2. Maybe I'm not exercising parts of Rails that 1.8.4 is incompatible with. To try to be a more productive citizen I tried to run your test suite for the latest commit and am getting a slew of failures. loading cucumber the way listed gives me: "can't convert Pathname into String" And the RSpec tests give me:
|
Do you have an instance of spork running while running the test suite? That has caused problems for me... it would help if spork would refuse to run specs outside of it's working directory. What command are you running to run the test suite? Which version of ruby? Rubygems? I usually run them with "bundle exec rspec spec/". I've run it with ruby 1.8.7, rubygems 1.5.0 and everything passes... features and specs. :S I've run the features with ruby 1.9.2, but not the specs... I'll give that a run |
I reproduced the failures with Ruby 1.9.2, thank you for raising those. (For some reason, they just fail when running specs, but not features… And Spork works for me in Ruby 1.9.2). Weird |
Hmm.. I was pretty sure that I just ran the features with Ruby 1.9.2… I also get an error there. Looks like I've got some work to do. Thanks, I'll get it fixed. |
Yeah, I'm using rubygems 1.3.7 and ruby 1.9.2, and I've been launching it the same way (bundle exec rspec spec). Maybe some part of my environment isn't sane but everything's pretty vanilla I believe. |
Ok... specs and features all passing with latest master. Ruby 1.9.2 / rubygems 1.8.1. They were compatibility issues with the test code and not the actual application itself :S |
Spork 0.9.0.rc6 is out with the test updates, although no application code was specifically written to address this. However, some other fixes were made and may resolve? May be worth trying. The tests I added to confirms that this is working, so it appears to be an interaction with webrat or steak. Maybe we'll need to add a test that tests interaction with webrat / steak. Hmm... |
Under RubyGems 1.7.2 & 1.8.1 all tests are passing except for two cucumber tests which both seem to be failing at file lookups
Also for 1.8.2 I'm failing at I'd like to start writing tests for Spork & RSpec integration tests (webrat / capybara / steak etc.) but to do that I'd obviously want to first get to green with cucumber, especially where file lookups are concerned. below is my Gemfile.lock GEM PLATFORMS DEPENDENCIES As a note I'm running 1.9.2p0. I'll upgrade that and see if the cucumber tests start passing. |
Ok... this is wild. That failure DOES show that spork isn't working. Sure enough... it (Scenario: respecting custom autoload paths # |
Anyone have a workaround for this? |
also interested in what's happening here - super weird |
This still happens for me on ruby 1.9.2p136, spork 0.9.0rc9 and webrat 0.7.3 |
Still happens on Ruby 1.9.2p180, Capybara 1.1.1, Rails 3.0.4, Sprok 0.9.0rc9 ;-( |
This doesn't seem to fix it for me. Still getting errors of unitialized constant WhateverHelper. |
However adding ActiveSupport::Dependencies.clear at the end of the prefork block did. |
I'm having this issue as well. Any luck? |
I'm also seeing this in my app. Interestingly, it only started happening when I installed activeadmin (0.3.4), which in turn installed fastercsv (1.5.4), formtastic (1.2.4), has_scope (0.5.1), inherited_resources (1.2.2), kaminari (0.13.0), meta_search (1.1.1), polyamorous (0.5.0), and responders (0.6.4). Just wondering if it is something in one of these gems that's causing the issue somehow? |
Had this problem as well after installing devise and so far none of the suggestions or commits above have helped. |
can confirm the problem here also, I have both installed (devise and activeadmin) so not sure which one is causing the error... anyone has a workaround? |
What needs to be done here, is someone needs to write an integration test to create the failure independent of any 3rd-party gems (other than rails). Spork-rails has an integration test that specifically tests for this, and it now passes using ruby 1.9.2. The above "Fix for issue #109. Helpers now available to request specs." may fix this specific issue, but breaks other known tested use cases, so I can't merge it. So, here's my challenge: Somebody go clone https://github.com/sporkrb/spork-rails. Look at the cucumber features. Copy one and modify it to manifest this specific bug. Submit it as a pull request and I will create a fix. |
Pretty sure this is related to ActiveAdmin and not one if it's dependencies. Will try and produce an independent test case though. |
I've tracked this down a bit further but not enough to work out what is going on. Hopefully these notes might help someone else If you are using ActiveAdmin then you add the following in routes.rb
To break it you can even simply add
In ActiveAdmin::Devise the lines that cause the issue are class SessionsController < ::Devise::SessionsController But including anything here will break it. For example module Foo Also causes the problem Makes no sense to me! |
I had this same issue with ActiveAdmin/Spork. This resolved it for me: https://github.com/gregbell/active_admin/wiki/Use-spork |
I've had a problem where methods in application_helper.rb were not being loaded when running Cucumber scenarios against Spork. I also use ActiveAdmin. The above made things work. I only needed to add Spork.trap_method(Rails::Application::RoutesReloader, :reload!) # Rails 3.1 to the env.rb prefork block. |
I have had the https://github.com/gregbell/active_admin/wiki/Use-spork fix in place for a while and it doesn't fix the helpers loading problem. |
I also have tried the https://github.com/gregbell/active_admin/wiki/Use-spork fix without success using guard-spork, devise, rails 3.1.6, ruby 1.9.3. |
Same problem exists on Rails 3.2.7 with Ruby 1.9.3, Spork 0.9.2. Helpers don't get loaded, there is also a ticket in spork-rails about this. |
same issue here when trying to use Turnip (spork 0.9.2, ruby 1.9.3, rails 3.2.8) |
same problem to load helpers here... if I include each helper, it works, but I would know some clean way to do this Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'shoulda/matchers/integrations/rspec'
include ApplicationHelper
include GraphicsHelper
... |
from #140 fixed the issue for me. |
@gravis thanks, but this not worked for me :/ |
In using both Steak and my own tool Saki, I get missing method errors whenever the views are loading in helper methods. This problem is also mentioned by folk on the Steak group:
http://groups.google.com/group/steakrb/browse_thread/thread/bbba8b1e79d323c2
and seems to be, a reincarnation of this issue:
http://groups.google.com/group/sporkgem/browse_thread/thread/631f143d2c10277d/2c71652b2e2c9f79?lnk=gst&q=helpers#2c71652b2e2c9f79
I backed out to 0.8.4 which seems to be doing the trick.
The text was updated successfully, but these errors were encountered: