Sha256: 89e7e4dd6cb102e28f9f7814b939e4c29e0da0a88f27b505f02e7eb8b8c9c06f

Contents?: true

Size: 927 Bytes

Versions: 11

Compression:

Stored size: 927 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe 'Sign in' do
  shared_examples 'sign_in' do
    subject do
      visit '/users/sign_in'
      fill_in 'user_email', with: user.email
      fill_in 'user_password', with: password
      find('input[type=submit]').click
    end

    let(:password) { 'pass1234' }
    let!(:user) { create :user, password: }

    it do
      subject
      expect(page).to have_text :all, 'No hay categorías de cosas que mostrar'
    end
  end

  # drivers = %i[
  #   selenium_headless
  #   selenium_chrome_headless
  #   selenium_chrome_headless_notebook
  #   selenium_chrome_headless_iphone
  # ]
  drivers = %i[selenium_chrome_headless_iphone]
  drivers = [ENV['DRIVER'].to_sym] if ENV['DRIVER'].present?

  drivers.each do |driver|
    context("with driver '#{driver}'") do
      before do
        driven_by driver
      end

      it_behaves_like 'sign_in'
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
pg_rails-7.5.1 pg_engine/spec/system/login_spec.rb
pg_rails-7.5.0 pg_engine/spec/system/login_spec.rb
pg_rails-7.4.3 pg_engine/spec/system/login_spec.rb
pg_rails-7.4.2 pg_engine/spec/system/login_spec.rb
pg_rails-7.4.1 pg_engine/spec/system/login_spec.rb
pg_rails-7.4.0 pg_engine/spec/system/login_spec.rb
pg_rails-7.3.5 pg_engine/spec/system/login_spec.rb
pg_rails-7.3.4 pg_engine/spec/system/login_spec.rb
pg_rails-7.3.3 pg_engine/spec/system/login_spec.rb
pg_rails-7.3.2 pg_engine/spec/system/login_spec.rb
pg_rails-7.3.1 pg_engine/spec/system/login_spec.rb