5
我升級我的版本的RSpec的到最新的版本,我有測試斷裂有類似的語法我怎樣寫這個使用RSpec
it "should delete a company" do
expect { click_link "Delete Company" }.should change(Company, :count).by(-1)
end
我看着documentation,我看不到任何會做到這一點在目前的優化版本...如何實現這個
我得到的錯誤任何想法是
9) Company Pages Edit page as an admin user should delete a company
Failure/Error: expect { click_link "Delete Company" }.should change(Company, :count).by(-1)
NoMethodError:
undefined method `call' for #<RSpec::Expectations::ExpectationTarget:0x007fccafdfc360>
# ./spec/requests/companies_spec.rb:79:in `block (3 levels) in <top (required)>'
這不應該是'''to'''而不是'''should'' '? – phoet 2012-07-10 21:29:26
我會測試一下 – Trace 2012-07-10 21:49:36
@phoet是正確的。 – 2012-07-10 21:53:05