例如,当用户已经登录时,用户不应该看到登录页面。我应该如何在 cucumber 中实现此功能?
Scenario: Authorizzation
Given I am logged in
Then I should not be asked to authenticate
Given(/^I am logged in$/) do
@user = User.new
end
Then(/^I should not be asked to authenticate$/) do
# what to write???
end
假设认证页面称为登录。