Sha256: f4f275b6678ed12bc0abf43e2998a82c570d61b1dfd0d37e0a13552417725f18

Contents?: true

Size: 1.41 KB

Versions: 3

Compression:

Stored size: 1.41 KB

Contents

require 'spec_helper'

describe 'javascript warnings', :js => true do
  it 'warns about excess page content' do
    visit("http://localhost:#{SERVERPORT}/pages/warnings")
    find("#fullpagelink").click
    sleep(0.5)
    alertmsg = page.driver.browser.switch_to.alert.text
    alertmsg.should include("EXTRA_CONTENT_DISCARDED")
    page.driver.browser.switch_to.alert.accept
    page.should have_content("You are on page 2")
  end

  it 'warns about missing dependencies' do
    visit("http://localhost:#{SERVERPORT}/pages/warnings")
    find("#disablehistoryjslink").click
    sleep(0.5)
    alertmsg = page.driver.browser.switch_to.alert.text
    alertmsg.should include("MISSING_DEPENDENCIES")
    page.driver.browser.switch_to.alert.accept
    page.should have_content("Disabled")
  end

  it 'warns about reference to more than one section of same id' do
    visit("http://localhost:#{SERVERPORT}/pages/warnings")
    find("#doublesectionlink").click
    alertmsg = page.driver.browser.switch_to.alert.text
    alertmsg.should include("UNIQUE_SECTION_NOT_FOUND")
    page.driver.browser.switch_to.alert.accept
  end

  it 'warns about reference to section which does not exist' do
    visit("http://localhost:#{SERVERPORT}/pages/warnings")
    find("#nosectionlink").click
    alertmsg = page.driver.browser.switch_to.alert.text
    alertmsg.should include("UNIQUE_SECTION_NOT_FOUND")
    page.driver.browser.switch_to.alert.accept
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ajax_pagination-0.6.3 spec/ajax_pagination/integration/warnings_spec.rb
ajax_pagination-0.6.2 spec/ajax_pagination/integration/warnings_spec.rb
ajax_pagination-0.6.1 spec/ajax_pagination/integration/warnings_spec.rb