Created
January 7, 2015 19:30
-
-
Save henrypoydar/4384e8cd95fa82c4ff53 to your computer and use it in GitHub Desktop.
minitest-rails "Unable to resolve controller"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArticlesController < ApplicationController | |
def index | |
render nothing: true | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
class ArticlesControllerTest < ActionController::TestCase | |
describe 'GET #index' do | |
setup { get :index } | |
it "does x" do | |
assert true | |
end | |
it "does y" do | |
assert true | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake test TEST=test/controllers/articles_controller_test.rb | |
Run options: --seed 60196 | |
# Running: | |
EE | |
Finished in 0.085434s, 23.4099 runs/s, 0.0000 assertions/s. | |
1) Error: | |
GET #index#test_0001_does x: | |
NameError: Unable to resolve controller for GET #index | |
2) Error: | |
GET #index#test_0002_does y: | |
NameError: Unable to resolve controller for GET #index | |
2 runs, 0 assertions, 0 failures, 2 errors, 0 skips |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV['RAILS_ENV'] ||= 'test' | |
require File.expand_path('../../config/environment', __FILE__) | |
require 'rails/test_help' | |
require 'minitest/rails' | |
require "minitest/rails/capybara" | |
require 'mocha/mini_test' | |
class ActiveSupport::TestCase | |
fixtures :all | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in my case, the problem was
require "minitest/rails/capybara"