#5 楼 @rubysir 最新的 selenium-webdriver 2.49 (released on January 13 2016) 应该不支持最新的 firefox 版本,relative https://github.com/SeleniumHQ/selenium/issues/1385
在使用 selenium-webdriver 做自动化测试的时候,不要随意更新 gem 和浏览器的版本。我们是在 branch 下测试成功后才 upgrade 的
一定要学!今年考了两次都没过。。。后悔有时间的时候没有学
Did you recently upgrade your firefox? Check the firefox version and your selenium webdriver gem version. Both up to date should work.
同事推荐过 Elasticsearch,准备应用到自己的项目 :plus1:
Build your own api::Activeresource
. The #find
, #save
etc actions are actually making api calls.
Why not use https://github.com/twbs/bootstrap-sass? Never use less-rails before
@msg7086 you're right. It will throw error if not found. (Apologise that I can't type CN on this machine...)
Release Load (6.1ms) SELECT `releases`.* FROM `releases` WHERE `releases`.`id` = 99 LIMIT 1
ActiveRecord::RecordNotFound: Couldn't find Release with 'id'=99
:plus1:
Do not use exception as the control flow ...
def current_cart
cart = Cart.find(session[:cart_id]) || Cart.create
session[:cart_id] ||= cart.id
cart
end
看了 2 楼的帖子,感觉事件没有个结论。只是纯属个人好奇
根据我在公司的经验,给新人的 get started 文件可以帮助新同事尽快 pick up. 同时给一个 high level overview,即可开始加入开发做小 task. Orientation 一般两到三天. 以上 ^^
:plus1:
#5 楼 @wxliuzifan The RSpec Book
If you're a QA, learn cucumber
and automation.
#2 楼 @wxliuzifan 哪一行报错?这里可能性很多光这样贴出代码很难 debug..
另外
expect(@sqlite_database).to receive(:authorSearch).with('author1').and_return(@book1,@book2)
你这里表达的意思是让@sqlite_database调用authorSearch
方法,参数是author1
, 然后第一次会返回@book1, 第二次返回@book2, 如果@sqlite_database根本没有这个方法,那当然会抛出NoMethodError
根据你的表达,我觉得你是想用 mock
allow(@sqlite_database).to receive(:authorSearch).with('author1').and_return(@book1,@book2)
然后当你接下来调用@sqlite_database.authorSearch('author1') 时,第一次会返回@book1, 第二次返回@book2
Make sense? FYI - https://coderwall.com/p/e80caq/rspec-allow-vs-expect
Can you specify what do you really want to test here?
If you are testing the logic inside the each
, you can do
result = { ab: "xxx" } # your expected output here
actual = books.each { |p| isbns.insert(0,"#{p.isbn}_") }
expect(result).to eq(actual)
#2 楼 @lawrence Ahhh, 不好意思,没看仔细以为你只想修改 commit history The Solution in Stack Overflow
Squash 这些 commits.
git rebase -i HEAD~2
# squash the last 2 commits
This is a good article about fixtures v.s. factorygirls
I'm the PM and will label this as LOW PRIORITY
:trollface:
@TsingHan Sorry for the delay. 今天刚刚看到。
Ahh, 原因是在fetch_club
方法。它不是直接查询数据库或者直接使用 Club Object. 而是用 Grape 调用一个 api call。所以你应该 mock 的是Grape::Endpoint
. 这里的信息 miss 了。
你用 mock 的时候,应该想清楚到底要 mock 哪个 object. 另外,RSpec 支持 verify_double
, 完善了以前double
的一个漏洞。FYI - http://relishapp.com/rspec/rspec-mocks/docs/verifying-doubles