Sha256: 29d851e140c98d2ea2aebd3e5bb8b6357c0aa8fd6066c3badda887aa12067102

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

require 'spec_helper'

describe 'paginating with javascript on', :type => :request, :driver => :selenium, :js => true do
  it 'works' do
    visit("http://localhost:#{SERVERPORT}") # goes to welcome page
    page.should have_no_selector('#aboutpagetitle')
    click_link 'About'
    page.should have_selector('#aboutpagetitle')
    page.should have_no_selector('#readmepagetitle')
    click_link 'Readme'
    page.should have_selector('#readmepagetitle')
    page.should have_no_selector('#aboutpagetitle')
  end
  it 'works with nested and multiple paginated sections' do
    visit("http://localhost:#{SERVERPORT}/changelog")
    page.should have_selector('.previous_page.disabled')
    find('#page_paginated_section').find('.next_page').click
    page.should have_no_selector('.previous_page.disabled')
    find('#signin').click
    visit("http://localhost:#{SERVERPORT}/posts")
    page.should have_selector('#page_paginated_section .previous_page.disabled')
    find('#page_paginated_section').find('.next_page').click
    sleep(1)
    page.should have_no_selector('#page_paginated_section .previous_page.disabled')
    page.should have_selector('#upcomingpage_paginated_section .previous_page.disabled')
    find('#upcomingpage_paginated_section').find('.next_page').click
    sleep(1)
    page.should have_no_selector('#upcomingpage_paginated_section .previous_page.disabled')
    page.should have_no_selector('#page_paginated_section .previous_page.disabled')
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ajax_pagination-0.5.1 spec/ajax_pagination/integration/paginate_spec.rb
ajax_pagination-0.5.0 spec/ajax_pagination/integration/paginate_spec.rb
ajax_pagination-0.4.0 spec/ajax_pagination/integration/paginate_spec.rb