Sha256: f4a41436aaf994f053da3d29ec68cb0c80edacbf4dbf776a739ac78406aad80f

Contents?: true

Size: 913 Bytes

Versions: 44

Compression:

Stored size: 913 Bytes

Contents

# frozen_string_literal: true
# spec/support/features/session_helpers.rb
module Features
  module SessionHelpers
    def sign_up_with(email, password)
      Capybara.exact = true
      visit new_user_registration_path
      fill_in 'Email', with: email
      fill_in 'Password', with: password
      fill_in 'Password confirmation', with: password
      click_button 'Sign up'
    end

    def sign_in(login = 'user1')
      email = "#{login}@#{login}.com"
      user = User.create(:email => email, :password => "password", :password_confirmation => "password")
      visit new_user_session_path
      fill_in("user_email", :with => email) 
      fill_in("user_password", :with => "password") 
      
      if has_button? "Sign in"
        click_button("Sign in")
      elsif has_button? "Log in"
        click_button("Log in")
      else
        raise "Unable to find sign in button"
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
blacklight-6.25.0 spec/support/features/session_helpers.rb
blacklight-6.24.0 spec/support/features/session_helpers.rb
blacklight-6.23.0 spec/support/features/session_helpers.rb
blacklight-6.22.0 spec/support/features/session_helpers.rb
blacklight-6.21.0 spec/support/features/session_helpers.rb
blacklight-6.20.0 spec/support/features/session_helpers.rb
blacklight-6.19.2 spec/support/features/session_helpers.rb
blacklight-6.19.1 spec/support/features/session_helpers.rb
blacklight-6.19.0 spec/support/features/session_helpers.rb
blacklight-6.18.0 spec/support/features/session_helpers.rb
blacklight-6.17.0 spec/support/features/session_helpers.rb
blacklight-6.16.0 spec/support/features/session_helpers.rb
blacklight-6.15.0 spec/support/features/session_helpers.rb
blacklight-7.0.0.rc1 spec/support/features/session_helpers.rb
blacklight-6.14.1 spec/support/features/session_helpers.rb
blacklight-6.14.0 spec/support/features/session_helpers.rb
blacklight-6.13.0 spec/support/features/session_helpers.rb
blacklight-6.12.0 spec/support/features/session_helpers.rb
blacklight-6.11.2 spec/support/features/session_helpers.rb
blacklight-6.11.1 spec/support/features/session_helpers.rb