Sha256: c5e112db493f784e64a192cf4b06dcf1ca10d3f02963ceb2d527b0b1716cc724

Contents?: true

Size: 883 Bytes

Versions: 42

Compression:

Stored size: 883 Bytes

Contents

# 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

42 entries across 42 versions & 1 rubygems

Version Path
blacklight-5.19.2 spec/support/features/session_helpers.rb
blacklight-5.19.1 spec/support/features/session_helpers.rb
blacklight-5.19.0 spec/support/features/session_helpers.rb
blacklight-5.18.0 spec/support/features/session_helpers.rb
blacklight-5.17.2 spec/support/features/session_helpers.rb
blacklight-6.0.0.pre5 spec/support/features/session_helpers.rb
blacklight-5.17.1 spec/support/features/session_helpers.rb
blacklight-5.17.0 spec/support/features/session_helpers.rb
blacklight-6.0.0.pre4 spec/support/features/session_helpers.rb
blacklight-5.16.4 spec/support/features/session_helpers.rb
blacklight-6.0.0.pre3 spec/support/features/session_helpers.rb
blacklight-5.16.3 spec/support/features/session_helpers.rb
blacklight-5.16.2 spec/support/features/session_helpers.rb
blacklight-5.16.1 spec/support/features/session_helpers.rb
blacklight-6.0.0.pre2 spec/support/features/session_helpers.rb
blacklight-6.0.0.pre1 spec/support/features/session_helpers.rb
blacklight-5.16.0 spec/support/features/session_helpers.rb
blacklight-5.15.0 spec/support/features/session_helpers.rb
blacklight-5.14.0 spec/support/features/session_helpers.rb
blacklight-5.13.1 spec/support/features/session_helpers.rb