Sha256: d336aea94ee9755657c6de07e2a8d58ca960e8936605e969acc640f9cd7855b5

Contents?: true

Size: 872 Bytes

Versions: 14

Compression:

Stored size: 872 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_on '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_on("Sign in")
      elsif has_button? "Log in"
        click_on("Log in")
      else
        raise "Unable to find sign in button"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
blacklight-8.8.4 spec/support/features/session_helpers.rb
blacklight-8.8.3 spec/support/features/session_helpers.rb
blacklight-8.8.2 spec/support/features/session_helpers.rb
blacklight-9.0.0.beta1 spec/support/features/session_helpers.rb
blacklight-8.8.1 spec/support/features/session_helpers.rb
blacklight-8.8.0 spec/support/features/session_helpers.rb
blacklight-8.7.0 spec/support/features/session_helpers.rb
blacklight-8.6.1 spec/support/features/session_helpers.rb
blacklight-8.6.0 spec/support/features/session_helpers.rb
blacklight-8.5.1 spec/support/features/session_helpers.rb
blacklight-8.5.0 spec/support/features/session_helpers.rb
blacklight-8.4.0 spec/support/features/session_helpers.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-8.3.0/spec/support/features/session_helpers.rb
blacklight-8.3.0 spec/support/features/session_helpers.rb