小编bco*_*ste的帖子

用设计和黄瓜测试登录

我正在尝试使用Cucumber测试登录功能.我的文件users_steps.rb包含

Given /^I am a user named "([^"]*)" with an email "([^"]*)" and password "([^"]*)"$/ do |name, email, password|
  u = User.new(:name => name,
               :email => email,
               :password => password,
               :password_confirmation => password)
  u.skip_confirmation!
  u.save!
end


When /^I sign in as "(.*)\/(.*)"$/ do |email, password|
  #Given %{I am not logged in}
  When %{I go to the sign in page}
  And %{I fill in "user_email" with "#{email}"}
  And %{I fill in "user_password" with "#{password}"}
  And %{I press "Log Me In"}
end …
Run Code Online (Sandbox Code Playgroud)

ruby-on-rails cucumber devise

6
推荐指数
1
解决办法
6318
查看次数

标签 统计

cucumber ×1

devise ×1

ruby-on-rails ×1