简体   繁体   English

rspec +水豚测试康康能力的最佳实践

[英]rspec+capybara best practies to test cancan abilities

hy, i'm testing cancan with rspec+capybara. 嗨,我正在用rspec + capybara测试cancan。 whit an integration test I'm visiting all the pages that need to be protected with cancan. 进行集成测试时,我正在访问所有需要用cancan保护的页面。 I have many pages to test and for each page i have many abilities to test, so the comlessity is very high. 我要测试的页面很多,每页都有很多测试能力,因此无聊感非常高。 In your experience wich is the best practies to make a full test of the abilities? 根据您的经验,最好的方法是对能力进行全面测试?

瑞安·贝茨(Ryan Bates)有一个wiki (向下滚动到rspec),介绍如何使用be_able_to匹配器测试rspec的功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM