Sha256: 1d2161fe616b223759665fb52e88aa07d72587501fac1af7f69dc6c50b187f9e

Contents?: true

Size: 1.03 KB

Versions: 11

Compression:

Stored size: 1.03 KB

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
    if marionette?(@session) || edge?(@session) || ie?(@session)
      skip "Firefox and Edge insist on prompting without providing a way to suppress"
    end
    @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

11 entries across 11 versions & 2 rubygems

Version Path
tdiary-5.0.9 vendor/bundle/gems/capybara-3.2.1/lib/capybara/spec/session/refresh_spec.rb
capybara-3.3.1 lib/capybara/spec/session/refresh_spec.rb
capybara-3.3.0 lib/capybara/spec/session/refresh_spec.rb
capybara-3.2.1 lib/capybara/spec/session/refresh_spec.rb
capybara-3.2.0 lib/capybara/spec/session/refresh_spec.rb
capybara-3.1.1 lib/capybara/spec/session/refresh_spec.rb
capybara-3.1.0 lib/capybara/spec/session/refresh_spec.rb
capybara-3.0.3 lib/capybara/spec/session/refresh_spec.rb
capybara-3.0.2 lib/capybara/spec/session/refresh_spec.rb
capybara-3.0.1 lib/capybara/spec/session/refresh_spec.rb
capybara-3.0.0 lib/capybara/spec/session/refresh_spec.rb