Sha256: dbf0f5e9f1dbbd5c506faaf7112eb9211d11238e6cefd2ed9c9fb3c77fe79860

Contents?: true

Size: 1.12 KB

Versions: 33

Compression:

Stored size: 1.12 KB

Contents

Then /^I should be able to display paginated models$/ do
  # Create our article model and three articles
  @article_model = FactoryGirl.build(:content_type, site: @site, name: 'Articles', order_by: '_position').tap do |ct|
    ct.entries_custom_fields.build label: 'Body', type: 'string', required: false
    ct.save!
  end

  %w(First Second Third).each do |body|
    @article_model.entries.create!(body: body)
  end

  # Create a page with template
  raw_template = %{
  {% paginate contents.articles by 2 %}
    {% for article in paginate.collection %}
      {{ article.body }}
    {% endfor %}
    {{ paginate | default_pagination }}
  {% endpaginate %}
  }
  FactoryGirl.create(:page, site: @site, slug: 'hello', parent: @site.pages.root.first, raw_template: raw_template)

  # The page should have the first two articles
  visit '/hello'
  page.should have_content 'First'
  page.should have_content 'Second'
  page.should_not have_content 'Third'

  # The second page should have the last article
  click_link '2'
  page.should_not have_content 'First'
  page.should_not have_content 'Second'
  page.should     have_content 'Third'
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
locomotivecms-3.0.0.rc3 features/step_definitions/pagination_steps.rb
locomotivecms-3.0.0.rc2 features/step_definitions/pagination_steps.rb
locomotivecms-3.0.0.rc1 features/step_definitions/pagination_steps.rb
locomotivecms-3.0.0.pre.beta.1 features/step_definitions/pagination_steps.rb
locomotivecms-3.0.0.pre.alpha.3 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.7 features/step_definitions/pagination_steps.rb
locomotivecms-3.0.0.pre.alpha.2 features/step_definitions/pagination_steps.rb
locomotivecms-3.0.0.pre.alpha features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.6 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.6.rc2 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.6.rc1 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.5 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.4 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.3 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.2 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.1 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.0 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.0.rc3 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.0.rc2 features/step_definitions/pagination_steps.rb
locomotive_cms-2.5.0.rc1 features/step_definitions/pagination_steps.rb