[英]How do I write this with rspec
I upgraded my version of rspec to the most current version and I have tests breaking that have similar syntax 我将我的rspec版本升级到最新版本,并且测试打破了具有类似语法的测试
it "should delete a company" do
expect { click_link "Delete Company" }.should change(Company, :count).by(-1)
end
I looked at the documentation and I could not see anything that will do this in the current verion...any ideas on how to achieve this 我查看了文档 ,在目前的版本中我看不到任何可以做到这一点的任何内容......关于如何实现这一目标的任何想法
The error I get is 我得到的错误是
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)>'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.