Sha256: 407b993cf702b2648afb062b3c5bc0bf7143f3bbb20df3fdd5c73e2d28bc95d0

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

require 'spec_helper'

describe BootstrapIt::ViewHelpers::Pagination do
  it { expect(helper.render).to have_tag 'ul.pagination' }
  it { expect(helper).to be_kind_of WrapIt::Container }
  it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Sizable }

  it 'renders links' do
    expect(helper { |h| h.link_item 'test', 'http://url' }.render).to have_tag(
      'ul > li > a[@href="http://url"][text()="test"]'
    )
  end
end

describe BootstrapIt::ViewHelpers::Pager do
  it { expect(helper.render).to have_tag 'ul.pager' }
  it { expect(helper).to be_kind_of WrapIt::Container }

  it 'renders links' do
    expect(helper { |h| h.link_item 'test', 'http://url' }.render).to have_tag(
      'ul > li > a[@href="http://url"][text()="test"]'
    )
  end

  it 'renders previous' do
    expect(helper { |h| h.previous 'test', 'http://url' }.render).to have_tag(
      'ul > li.previous > a[@href="http://url"][text()="test"]'
    )
  end

  it 'renders next' do
    expect(helper { |h| h.next 'test', 'http://url' }.render).to have_tag(
      'ul > li.next > a[@href="http://url"][text()="test"]'
    )
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bootstrap_it-0.1.2 spec/view_helpers/pagination_spec.rb