Sha256: f84351032898986025eb281d34b296326caa6ebfbe1a5b10929c6d7081983ffb
Contents?: true
Size: 872 Bytes
Versions: 3
Compression:
Stored size: 872 Bytes
Contents
Given /^I am logged out$/ do if page.all(:css, "a", :text => "Logout").size > 0 click_link "Logout" end end Given /^I am logged in$/ do step 'an admin user "admin@example.com" exists' if page.all(:css, "a", :text => "Logout").size > 0 click_link "Logout" end visit new_admin_user_session_path fill_in "Email", :with => "admin@example.com" fill_in "Password", :with => "password" click_button "Login" end Given /^an admin user "([^"]*)" exists$/ do |admin_email| user = AdminUser.find_or_create_by_email :email => admin_email, :password => "password", :password_confirmation => "password" unless user.persisted? puts "Coult not create an admin user #{admin_email}: #{user.errors.full_messages}" raise "Could not create an admin user" end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
activeadmin-0.4.4 | features/step_definitions/user_steps.rb |
activeadmin-0.4.3 | features/step_definitions/user_steps.rb |
activeadmin-0.4.2 | features/step_definitions/user_steps.rb |