我是Ruby on Rails的新手,我正在关注Michael Hartl的Ruby on rails教程。我在测试驱动开发的第3章。当我运行命令Michael Hartl的RoR教程第3章rails生成integration_test什么也不做
轨产生integration_test static_pages
它什么都不做。没有错误,没有规范文件被创建。我已经使用railsinstaller安装了rails。
接下来要做什么?
我是Ruby on Rails的新手,我正在关注Michael Hartl的Ruby on rails教程。我在测试驱动开发的第3章。当我运行命令Michael Hartl的RoR教程第3章rails生成integration_test什么也不做
轨产生integration_test static_pages
它什么都不做。没有错误,没有规范文件被创建。我已经使用railsinstaller安装了rails。
接下来要做什么?
我不知道为什么它不为您生成文件。它在我尝试它时起作用。只有
一个文件被生成:
require 'test_helper'
class StaticPagesTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end
它出现在test/integration/static_pages_test.rb
不知道为什么你会得到任何错误。我必须使用
bundle exec rails generate integration_test static_pages
它的工作。
我有同样的问题(即没有错误,没有规范文件创建)和EricM的解决方案不适合我。我手动创建的投机/请求/ static_pages_spec.rb以下文件,它似乎已经奏效(我不得不创建规范的要求目录):
require 'spec_helper'
describe "Static pages" do
describe "Home page" do
it "should have the content 'Sample App'" do
visit '/static_pages/home'
page.should have_content('Sample App')
end
end
end
这是清单3.9中使用相同的代码这本书:http://ruby.railstutorial.org/chapters/static-pages#sec:TDD
这是/不是“过于本地化”! – Phlip