Sha256: 36bc1ee0314fdbd1e17f515c25f39424f35e255a1bbfab0091404b75e787299a
Contents?: true
Size: 1.02 KB
Versions: 15
Compression:
Stored size: 1.02 KB
Contents
# Copyright (c) 2008-2013 Michael Dvorkin and contributors. # # Fat Free CRM is freely distributable under the terms of MIT license. # See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php #------------------------------------------------------------------------------ module HelperMethods # Put helper methods you need to be available in all acceptance specs here. def do_login(options = {}) @user = FactoryGirl.create(:user, options) visit '/login' fill_in "authentication_username", with: @user.username fill_in "authentication_password", with: @user.password click_button "Login" end def login_as_user(user) visit '/login' fill_in "authentication_username", with: user.username fill_in "authentication_password", with: user.password click_button "Login" end # if we're already logged in, don't bother doing it again def do_login_if_not_already(options = {}) do_login(options) unless @user.present? end end RSpec.configuration.include HelperMethods, type: :feature
Version data entries
15 entries across 15 versions & 2 rubygems