2

Just wondering what the best way to setup something in Minitest acceptance tests to log in before a test.

I'm switching from Cucumber, where it would usually be something like this:

step("log in as userx")

Would I simply define a method to utilise Capybara in my minitest_helper.rb or is there a better way?

4

1 回答 1

0

由于您没有测试登录功能,您应该能够创建您的User类的对象并将其登录(设置会话)。

如果你愿意,你可以把它放进你的minitest_helper.rb,这样每次你需要一个登录用户时你都会有一个空白。

于 2013-05-10T10:19:21.733 回答