Sha256: 26faaa9809e2776064482f6e7f2b1ca142fb1c3c6a1cd0ce2a83889bbc62d8b7

Contents?: true

Size: 883 Bytes

Versions: 74

Compression:

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

74 entries across 74 versions & 2 rubygems

Version Path
blacklight-7.40.0 spec/support/features/session_helpers.rb
blacklight-7.39.0 spec/support/features/session_helpers.rb
blacklight-7.38.0 spec/support/features/session_helpers.rb
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/blacklight-7.37.0/spec/support/features/session_helpers.rb
blacklight-7.37.0 spec/support/features/session_helpers.rb
blacklight-7.36.2 spec/support/features/session_helpers.rb
blacklight-7.36.1 spec/support/features/session_helpers.rb
blacklight-7.36.0 spec/support/features/session_helpers.rb
blacklight-7.35.0 spec/support/features/session_helpers.rb
blacklight-7.34.0 spec/support/features/session_helpers.rb
blacklight-7.33.1 spec/support/features/session_helpers.rb
blacklight-7.33.0 spec/support/features/session_helpers.rb
blacklight-7.32.0 spec/support/features/session_helpers.rb
blacklight-7.31.0 spec/support/features/session_helpers.rb
blacklight-7.30.0 spec/support/features/session_helpers.rb
blacklight-7.29.0 spec/support/features/session_helpers.rb
blacklight-7.28.0 spec/support/features/session_helpers.rb
blacklight-7.27.1 spec/support/features/session_helpers.rb
blacklight-7.27.0 spec/support/features/session_helpers.rb
blacklight-7.26.1 spec/support/features/session_helpers.rb