Sha256: 3c7b623ad781daf361b016b2f79fb40ea18dcd5827ec4d7b513f6cb1936be4ce

Contents?: true

Size: 1.04 KB

Versions: 11

Compression:

Stored size: 1.04 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

11 entries across 11 versions & 1 rubygems

Version Path
fat_free_crm-0.13.6 spec/features/support/helpers.rb
fat_free_crm-0.13.5 spec/features/support/helpers.rb
fat_free_crm-0.13.4 spec/features/support/helpers.rb
fat_free_crm-0.13.3 spec/features/support/helpers.rb
fat_free_crm-0.13.2 spec/features/support/helpers.rb
fat_free_crm-0.12.3 spec/features/support/helpers.rb
fat_free_crm-0.12.2 spec/features/support/helpers.rb
fat_free_crm-0.13.1 spec/features/support/helpers.rb
fat_free_crm-0.12.1 spec/features/support/helpers.rb
fat_free_crm-0.13.0 spec/features/support/helpers.rb
fat_free_crm-0.12.0 spec/features/support/helpers.rb