Git Product home page Git Product logo

everydayrailsrspec-cn's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

everydayrailsrspec-cn's Issues

文件扩展名错误

page 79
spec/support/shared_db_connection.db -> spec/support/shared_db_connection.rb

几处小疑问

可能是我一直以来几乎都不写测试的缘故, 在leanpub入手的这本, 读下来感觉比早前硬啃的 The RSpec Book 接地气得多.

不过翻看的过程中, 感觉有几个地方稍微有点不够通畅

page 47

看一下 description 块后的 before 块。

感觉应该是describe

page 61

而是转向专门创建的 denied_pat ,

denied_path

page 70

我们不能忽略对测试的管理,也不同无视保证测试简洁而有条理的责任。

page 72

Capybara 的 DSL 很容易理解,及时不是程序员也能顺畅阅读功能测试

page 110

新建一个程序,比如博客或者待办事项程序,编写一些功能练习 TDD。不过测试技术如何,想想如何决定实现哪些功能?想要提高编写邮件发送功能测试的能力?

第 78 页中的一些疑问

当然了,Cucumber 也有很多狂热支持者,很多开发团队会大量使用。所以,可能最终你还是要数量使用这个框架。

“可能最终你还是要数量使用这个框架”,这句中的“数量”可能是多余的

如果要使用 Cuucmber,切记小心 2011 年 12 月之前的教程。

Cuucmber 拼写有误

第 2 章,我们在 Gemfile 的 test 组中加入了 Capybara39、DatabaseCleaner40 和 Launchy41。如果你之前加入,现在请加上,我们终于要使用这些依赖库了。

“如果你之前加入,现在请加上”,应该是要表达“如果之前没加入,现在请加上”

103 页和 111 页中的疑问

第 103 页

虽然像邮件发送、文件上传、时间处理、Web 服务以及 Rake 任务这些功能不是程序的中头绪

“中头绪” 可能想表达的是 “重头戏”

第 111 页

修正这个错误最简单的方法是在试图中加入一些代码

"试图" 可能应该是 ”视图“

63 页代码中,PUT 应该改为 PATCH

63 页的代码中对于 update 操作使用的 http method 为 PUT,但 53 页开始已经提到:

从 Rails 4.0 开始 update 动作响应的是 PATCH 请求。

所以还是前后保持一致都使用 PATCH 代替 PUT 好些,估计是英文版本身的问题。

describe 'PUT #update' do
  it "requires login" do
    put :update, id: create(:contact),
    contact: attributes_for(:contact)
    expect(response).to redirect_to login_url
  end
end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.