Rake测试不会运行我的控制器测试

时间:2016-06-15 20:14:34

标签: ruby-on-rails tdd

尝试学习TDD并使用railstutorial。但不知何故bundle exec rake test不会运行我的所有控制器测试。下面分享我的宝石列表,controller_test代码和rake测试的输出,我做错了什么? 先感谢您 这是我的宝石列表

    source 'https://rubygems.org'

  gem 'rails'
  gem 'sass-rails', '5.0.2'
  gem 'uglifier', '2.5.3'
  gem 'coffee-rails', '4.1.0'
  gem 'jquery-rails', '4.0.3'
  gem 'turbolinks', '2.3.0'
  gem 'jbuilder', '2.2.3'
  gem 'sdoc', '0.4.0', group: :doc
  gem 'tzinfo-data'

group :development, :test do
  gem 'sqlite3'
  gem 'byebug', '3.4.0'
  gem 'spring', '1.1.3'
end

group :test do
  gem 'minitest-reporters', '1.0.5'
  gem 'mini_backtrace', '0.1.3'
  gem 'guard-minitest', '2.3.1'
end

group :production do
  gem 'pg'
  gem 'rails_12factor'
end

这是我的controller_test

require 'test_helper'

class StaticPagesControllerTest < ActionController::TestCase
  test "should get home" do
    get :home
    assert_response :success
  end

  test "should get help" do
    get :help
    assert_response :success
  end

  test "should get about" do
    get :about
    assert_response :success
  end
end

当我运行bundle exec rake test 时(即使我没有关于页面似乎只是运行2个测试而不是第三个测试而且所有测试都通过了。

Finished in 0.303118s, 6.5981 runs/s, 6.5981 assertions/s.

2 runs, 2 assertions, 0 failures, 0 errors, 0 skips

0 个答案:

没有答案