-
Notifications
You must be signed in to change notification settings - Fork 33
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
undefined method `html_tag' while testing with rspec and spork #20
Comments
I'm not totally sure what's going on with that. I'm using spork on projects and am not having any issues. But I'm posting my Gemfile and spec_helper in case it helps: gem 'html5-rails'
group :assets do
gem 'compass-rails'
gem 'compass-h5bp'
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end spec_helper.rb: require 'rubygems'
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path("../../config/environment", __FILE__)
require 'rspec/rails'
require 'rspec/autorun'
RSpec.configure do |config|
config.use_transactional_fixtures = true
config.infer_base_class_for_anonymous_controllers = false
config.mock_with :rspec
end
end
Spork.each_run do
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
end |
@amuino did you ever solve this? I'm having the same issue. If I temporarily replace the html_tag with %html, then it throws an error on google_account_id. Outside of Spork, tests work fine. |
No, not solved. I tried a few things but couldn't make it work. |
@amuino - In case you're still dealing with this, I finally realised that this was being caused by a spork issue sporkrb/spork#109 . Applying the workaround mentioned here - sporkrb/spork#140 - solved it for me. |
@joegatt thanks, solved the errors for me. I'm closing this issue since the cause seems to be spork itself. |
I'm using
html_tag
fine in development, staging and test environments, but it raises an error when using rspec with spork to test the controllers andrender_views
is used.I have the gem declared outside of any scope, so it is available for the test environment.
It works fine when used outside of spork (
rspec --no-drb spec/whatever_spec.rb
)I've tried to manually add the helpers on the prefork and each_run blocks without any effect.
Any suggestions or workarounds?
The text was updated successfully, but these errors were encountered: