Sha256: 7c2406a6530eed8c560b965235726917423b693427778a51ed9fdd63bd2ec812

Contents?: true

Size: 892 Bytes

Versions: 14

Compression:

Stored size: 892 Bytes

Contents

# frozen_string_literal: true

Capybara::SpecHelper.spec '#refresh' do
  it 'reload the page' do
    @session.visit('/form')
    expect(@session).to have_select('form_locale', selected: 'English')
    @session.select('Swedish', from: 'form_locale')
    expect(@session).to have_select('form_locale', selected: 'Swedish')
    @session.refresh
    expect(@session).to have_select('form_locale', selected: 'English')
  end

  it 'raises any errors caught inside the server', requires: [:server] do
    quietly { @session.visit('/error') }
    expect do
      @session.refresh
    end.to raise_error(TestApp::TestAppError)
  end

  it 'it reposts' do
    @session.visit('/form')
    @session.select('Sweden', from: 'form_region')
    @session.click_button('awesome')
    expect do
      @session.refresh
      sleep 2
    end.to change { extract_results(@session)['post_count'] }.by(1)
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
tdiary-5.0.11 vendor/bundle/gems/capybara-3.6.0/lib/capybara/spec/session/refresh_spec.rb
capybara-3.9.0 lib/capybara/spec/session/refresh_spec.rb
capybara-3.8.2 lib/capybara/spec/session/refresh_spec.rb
capybara-3.8.1 lib/capybara/spec/session/refresh_spec.rb
capybara-3.8.0 lib/capybara/spec/session/refresh_spec.rb
capybara-3.7.2 lib/capybara/spec/session/refresh_spec.rb
capybara-3.7.1 lib/capybara/spec/session/refresh_spec.rb
capybara-3.7.0 lib/capybara/spec/session/refresh_spec.rb
capybara-3.6.0 lib/capybara/spec/session/refresh_spec.rb
capybara-3.5.1 lib/capybara/spec/session/refresh_spec.rb
capybara-3.5.0 lib/capybara/spec/session/refresh_spec.rb
capybara-3.4.2 lib/capybara/spec/session/refresh_spec.rb
capybara-3.4.1 lib/capybara/spec/session/refresh_spec.rb
capybara-3.4.0 lib/capybara/spec/session/refresh_spec.rb