单元测试中 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》是一本经典的Rails开发指南,中文版的出版使得更多的中国开发者能够深入理解并应用敏捷开发方法与Ruby on Rails框架。这本书是Rails开发者的必备参考资料,它详细介绍了如何...
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 ...
《敏捷Web开发与Rails》第四版是一本专为软件开发者设计的权威指南,全面涵盖了使用Ruby on Rails框架进行敏捷Web应用开发的知识。Rails 3是该版本的重点,它引入了许多新特性和改进,使得开发过程更为高效且灵活。...
### 敏捷Web开发与Rails 3:关键知识点解析 #### 一、Rails版本与兼容性 本书《敏捷Web开发与Rails》第三版是基于Rails 2编写的。截至本书印刷时,当前可用的Rails Gem版本为2.1。书中所包含的所有代码均已在该...
《敏捷Web开发与Rails:程序指南 第四版》是一本深度探讨使用Ruby on Rails框架进行敏捷Web应用开发的专业书籍。本书旨在帮助开发者充分利用Rails 4的特性,提高开发效率,实现快速迭代和高质量的代码编写。 Rails是...
《Agile Web Development with Rails》(敏捷Web开发:Ruby on Rails)这本书,作为Rails开发新手的教材,强调了敏捷开发方法,并以其帮助开发者建立起一个实用的Web应用。从给出的文件信息来看,这本书正在编写过程...
Agile Web Development with Rails 1-14节_ppt(老师发的修正版)
agile web development with rails 5(英文电子书).............................................................................................................................................................
### Agile Web Development with Rails 第四版 #### 书籍概述与价值 《Agile Web Development with Rails》第四版是一本经典的Rails开发指南,旨在为开发者提供一套全面、实用且高效的敏捷开发方法论。本书由Sam ...
《敏捷Web开发与Rails》是一本深度探讨如何利用Ruby on Rails框架进行敏捷Web开发的指导书籍,由Dave Thomas、David Heinemeier Hansson等多位在Rails社区有着深厚贡献的作者共同编写。本书不仅覆盖了Rails的基本...
Agile Web Development with Rails, 2nd Edition <br>有两份PDF文件,大小分别是7.39MB和6.55MB <br>作者: Dave Thomas , David Heinemeier Hansson , Leon Breedt , Mike Clark , James Duncan Davidson ,...
《敏捷Web开发与Rails 2nd Edition》源码解析 在Web开发领域,Rails框架以其高效、灵活和生产力提升的特点,成为了许多开发者首选的工具。《敏捷Web开发与Rails 2nd Edition》这本书深入浅出地介绍了如何使用Ruby ...
《Agile Web Development with Rails-Second Edition-Beta》是一本专注于使用Ruby on Rails进行敏捷Web开发的书籍。这本书的第二版beta版提供了关于如何利用Rails框架高效构建动态、响应式网站的深入指导。作者们...
Agile Web Development with Rails, Third Edition by Sam Ruby, Dave Thomas, David Heinemeier Hansson Rails just keeps on changing. Rails 2, released in 2008, brings hundreds of improvements, including...
### 敏捷Web开发与Rails框架(第二版) #### 关于Rails版本的重要信息 Rails作为一个不断进化的框架,其核心开发者团队一直在进行各种改进、添加新功能以及修复已知问题等工作。随着时间推移,他们会定期将最新的...