Sha256: dcc0ba6dbfda553442fe0186c44cb92da1f68da8f10f3183adae5743f331c984

Contents?: true

Size: 884 Bytes

Versions: 14

Compression:

Stored size: 884 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.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

14 entries across 14 versions & 1 rubygems

Version Path
blacklight-8.2.2 spec/support/features/session_helpers.rb
blacklight-8.2.1 spec/support/features/session_helpers.rb
blacklight-8.2.0 spec/support/features/session_helpers.rb
blacklight-8.1.0 spec/support/features/session_helpers.rb
blacklight-8.0.1 spec/support/features/session_helpers.rb
blacklight-8.0.0 spec/support/features/session_helpers.rb
blacklight-8.0.0.beta8 spec/support/features/session_helpers.rb
blacklight-8.0.0.beta7 spec/support/features/session_helpers.rb
blacklight-8.0.0.beta6 spec/support/features/session_helpers.rb
blacklight-8.0.0.beta5 spec/support/features/session_helpers.rb
blacklight-8.0.0.beta4 spec/support/features/session_helpers.rb
blacklight-8.0.0.beta3 spec/support/features/session_helpers.rb
blacklight-8.0.0.beta2 spec/support/features/session_helpers.rb
blacklight-8.0.0.beta1 spec/support/features/session_helpers.rb