Sha256: d395a91d1cff0284f6675fcc735228be834fa2f66b5d550f10f962b9a547a5b3

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

# frozen_string_literal: true

describe 'Choosing files', type: :feature, js: true do
  before do
    visit '/'
  end

  shared_examples 'browseable files' do
    # This is a work-around until the support for Webpacker is resolved
    #
    # The following error is raised for Ruby releases 2.6.z
    # Failure/Error: events = conf.options[:Silent] ? ::Puma::Events.strings : ::Puma::Events.stdio
    #
    # NoMethodError:
    #   undefined method `stdio' for Puma::Events:Class
    xit 'selects files from the filesystem' do
      click_button('Browse')
      wait_for_ajax

      expect(page).to have_selector '#browse-everything'
      expect(page).to have_link 'config.ru'
      find(:css, '#config-ru').set(true)

      within('.modal-footer') do
        click_button('Submit')
      end

      wait_for_ajax

      expect(page).to have_selector('#status', text: '1 items selected')
    end
  end

  context 'when Turbolinks are enabled', fail: true do
    before { click_link('Enter Test App (Turbolinks)') }

    it_behaves_like 'browseable files'
  end

  context 'when Turbolinks are disabled' do
    before { click_link('Enter Test App (No Turbolinks)') }

    it_behaves_like 'browseable files'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
browse-everything-1.5.0 spec/features/select_files_spec.rb
browse-everything-1.4.0 spec/features/select_files_spec.rb
browse-everything-1.3.0 spec/features/select_files_spec.rb