简体   繁体   English

改装迈克尔·哈特尔(Michael Hartl)的教程:将rspec测试放在哪里?

[英]Modding Michael Hartl's railstutorial: Where to place rspec test?

I am playing around with Michael Hartl's railstutorial . 我正在玩迈克尔·哈特尔(Michael Hartl)的书架 I want to limit access to profile pages so only the owner can see his/hers profile. 我想限制访问个人资料页面,以便只有所有者才能看到他/她的个人资料。 First task is to write the appropriate rspec test, but what is the logical location of this: user_pages or authentication_pages ? 第一项任务是编写适当的rspec测试,但是此操作的逻辑位置是: user_pagesauthentication_pages

Probably user_pages, though it could easily go in authentication. 可能是user_pages,尽管可以轻松进行身份验证。 I think in this situation, you're best to just write the test and keep going. 我认为在这种情况下,最好只编写测试并继续进行。 If, later, you find it sits better in a different place, move it. 如果以后发现它在其他地方坐得更好,请移动它。

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

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