【发布时间】:2011-04-15 15:57:57
【问题描述】:
我对 Rails 还很陌生,无法理解其中的一些结构。
我正在关注Rails Tutorial 并看到如下代码:
require 'spec_helper'
describe "Users" do
describe "signup" do
describe "failure" do
it "should not make a new user" do
visit signup_path
fill_in "Name", :with => ""
fill_in "Email", :with => ""
fill_in "Password", :with => ""
fill_in "Confirmation", :with => ""
click_button
response.should render_template('users/new')
response.should have_selector("div#error_explanation")
end
end
end
end
我现在正在尝试进行类似的测试,但我不知道从哪里开始。我试图在互联网上查找“访问”方法的文档,但没有成功。它是 Rails 测试套件的一部分吗?规范?我将如何为自己回答这个问题,以及如何更好地理解集成测试?有我可以使用的详尽教程吗?
【问题讨论】:
-
看起来是在 Webrat 中??太多的事情同时发生。有没有“综合”的集成测试教程?
标签: ruby-on-rails rspec integration-testing