You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the minitest-spec-rails gem to enable the Minitest::Spec::DSL in my Rails tests. I can run spec-style tests when I use "rake test", but when running tests with "zeus test," they raise errors.
In my application, I'm getting NoMethodError: undefined method 'assert_difference' for #<#<Class:0x007fc16604e8e8>:0x007fc165598d90> and NoMethodError: undefined method 'users' for #<#<Class:0x007fc16604e8e8>:0x007fc1655db078> errors. (The undefined method 'users' is referring to a fixture helper.)
require'test_helper'classUsersControllerTest < ActionController::TestCasedescribe'specs'dolet(:user){users(:test_user)}describe'creating a new user'doit'creates a new user'doassert_difference('User.count')dopost:create,user: {}endendit'redirects to the user path'doassert_redirected_touser_path(user)endendendend
I checked ActionController::TestCase.ancestors in both cases, and when running with "zeus test", the following ancestors are missing: MiniTestSpecRails::Init::ActionControllerBehavior, MiniTestSpecRails::DSL, Minitest::Spec::DSL::InstanceMethods,
MiniTestSpecRails::Init::ActiveSupportBehavior.
I have tried to reproduce this in a new Rails 4.2.6 application, pulling in only "minitest-spec-rails," and I get an undefined method 'it' for ApplicationControllerTest:Class (NoMethodError) error.
classApplicationControllerTest < ActionController::TestCasetest'the old way'doasserttrueendit'works like new'doexpect(true).must_equaltrueendend
I suspect I need to add something to the custom_plan.rb file, but I'm not sure what. Could this be related to the minitest-spec-rails Railtie's conditional on Rails.env.test??
I've been using zeus and "minitest-spec-rails" successfully together in a Rails 3 app, but Rails 4 is having none of it.
The text was updated successfully, but these errors were encountered:
Rails.env.test? needs to be true before calling Bundler.require(:test). I'm not sure why they're enforcing initialization only when the Rails environment is "test". It seems like that should be handled by putting the gem in the :test group in the Gemfile.
Would it be appropriate to move the RAILS_ENV line before the Bundler.require line in both test_enviroment and development_environment in zeus? If so, I can generate a patch.
OS X 10.9.5
Ruby 2.2.1
Rails 4.2.6
zeus 0.15.4
I'm using the minitest-spec-rails gem to enable the Minitest::Spec::DSL in my Rails tests. I can run spec-style tests when I use "rake test", but when running tests with "zeus test," they raise errors.
In my application, I'm getting
NoMethodError: undefined method 'assert_difference' for #<#<Class:0x007fc16604e8e8>:0x007fc165598d90>
andNoMethodError: undefined method 'users' for #<#<Class:0x007fc16604e8e8>:0x007fc1655db078>
errors. (Theundefined method 'users'
is referring to a fixture helper.)I checked ActionController::TestCase.ancestors in both cases, and when running with "zeus test", the following ancestors are missing: MiniTestSpecRails::Init::ActionControllerBehavior, MiniTestSpecRails::DSL, Minitest::Spec::DSL::InstanceMethods,
MiniTestSpecRails::Init::ActiveSupportBehavior.
I have tried to reproduce this in a new Rails 4.2.6 application, pulling in only "minitest-spec-rails," and I get an
undefined method 'it' for ApplicationControllerTest:Class (NoMethodError)
error.I suspect I need to add something to the
custom_plan.rb
file, but I'm not sure what. Could this be related to the minitest-spec-rails Railtie's conditional onRails.env.test?
?I've been using zeus and "minitest-spec-rails" successfully together in a Rails 3 app, but Rails 4 is having none of it.
The text was updated successfully, but these errors were encountered: