单元测试中 product.errors.invalid? 的用法
p 181
# product.rb
validates_presence_of :title
def test_invalid_with_empty+attributes
product = Product.new
assert !product.valid?
assert product.errors.invalid?(:title)
end
p190
assert_match(pattern, string,
message)
assert_not_match(pattern, string,
message)
assert(/flower/i, user.town)
p192
仅测试,类中的一个方法
ruby test/functional/login_controller_test.rb -n test_index
p196
xmlhttprequest 的测试支持
xhr(:get, :add_to_cart, :id => 11)
p198
针对功能测试的辅助方法
1.
p198
tag = find_tag :tag => "form",
:attributes => {:action => "/store/add_to_cart/993"}
assert_equal "post", tag.attributes["method"]
2.
p199
assert_select "div#cart" do
assert_select "table" do
assert_select "tr", :count => 3
assert_select "tr.total-line td:last-of-type", "$57.70"
end
end
3
p200 简单选择器
p201 选择器链
4.
集成测试
ruby script\generate integration_test user_stories
分享到:
相关推荐
Agile Web Development with Rails 5 英文无水印原版pdf pdf所有页面使用FoxitReader、PDF-XChangeViewer、SumatraPDF和Firefox测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书...
Agile Web Development with Rails 3nd Edition beta
Agile Web Development with Rails 2nd Edition
Agile Web Development with Rails (PDF)
Agile Web Development with Rails
Agile Web Development with Rails 2nd Edition源码
Agile Web Development With Rails Fourth Edition 2010年最新版本
Ruby on Rails helps you produce high-quality, beautiful-looking web applications quickly. You concentrate on creating the application, and Rails takes care of the details., Tens of thousands of ...
Pragmatic Bookshelf - Agile Web Development with Rails 2nd Edition2正式版本PDF,非常清晰.
没什么好介绍的beta版,pdf 第四版,包括Rails 3的内容。
Pragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2ndPragmatic - Agile Web Development with Rails 2...
Agile Web Development with Rails 1-14节_ppt(老师发的修正版)
agile web development with rails 5(英文电子书).............................................................................................................................................................
正式版 已经上传, 请到下面链接下载 http://download.csdn.net/source/3432550
Agile Web Development with Rails (4th edition).pdf
Agile Web Development with Rails.
Agile Web Development with Rails 3nd Edition Beta