Sha256: 6a9948202682068e9c48eabee4e98e1e4b9465268371e85de26c24735cdd2542

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 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
    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(0.5)
    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.3.0 spec/ajax_pagination/integration/paginate_spec.rb
ajax_pagination-0.2.0 spec/ajax_pagination/integration/paginate_spec.rb
ajax_pagination-0.1.0 spec/ajax_pagination/integration/paginate_spec.rb