Sha256: c9ad1b4908cd0f0b9669cef75186f69b92c0d374a1f779f2593bc1aee0bb0022

Contents?: true

Size: 1.06 KB

Versions: 7

Compression:

Stored size: 1.06 KB

Contents

# encoding: UTF-8
require 'spec_helper'

feature 'Users' do
  background do
    1.upto(100) {|i| User.create! :name => "user#{'%03d' % i}" }
  end
  scenario 'navigating by pagination links' do
    visit '/users'

    within 'nav.pagination' do
      within 'li.page.active' do
        page.should have_content '1'
      end
      within 'li.next' do
        click_link 'Next ›'
      end
    end

    within 'nav.pagination' do
      within 'li.page.active' do
        page.should have_content '2'
      end
      within 'li.last' do
        click_link 'Last »'
      end
    end

    within 'nav.pagination' do
      within 'li.page.active' do
        page.should have_content '4'
      end
      within 'li.prev' do
        click_link '‹ Prev'
      end
    end

    within 'nav.pagination' do
      within 'li.page.active' do
        page.should have_content '3'
      end
      within 'li.first' do
        click_link '« First'
      end
    end

    within 'nav.pagination' do
      within 'li.page.active' do
        page.should have_content '1'
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
bootstrap_pager-0.11.0 spec/requests/users_spec.rb
bootstrap_pager-0.10.1 spec/requests/users_spec.rb
bootstrap_pager-0.10.0 spec/requests/users_spec.rb
bootstrap_pager-0.9.3 spec/requests/users_spec.rb
bootstrap_pager-0.9.2 spec/requests/users_spec.rb
bootstrap_pager-0.9.1 spec/requests/users_spec.rb
bootstrap_pager-0.9.0 spec/requests/users_spec.rb