Sha256: 843e107ef9e18663a86535dc15c8e3052566c553055ac087af278be8f693d0f9

Contents?: true

Size: 916 Bytes

Versions: 31

Compression:

Stored size: 916 Bytes

Contents

require 'test_helper'
require "ui_bibz/ui/ux/table/components/store"
require 'will_paginate'

class StoreTest < ActionView::TestCase
  include WillPaginate::ActionView

  setup do
    create_list(:user, 25)
    params = {
      controller: 'users',
      action:     'index',
      sort:       'users.name_fr',
      direction:  'asc',
      per_page:   10,
      page:       1
    }
    users  = User.table_search_pagination(params, session)
    @store = UiBibz::Ui::Ux::Store.new users
  end

  test 'total pages' do
    assert_equal @store.total_pages, 3
  end

  test 'current page' do
    assert_equal @store.current_page, 1
  end

  test 'limit value' do
    assert_equal @store.limit_value, 10
  end

  test 'model' do
    assert_equal @store.model, User
  end

  test 'records' do
    assert_equal @store.records.count, 25
  end

  test 'controller' do
    assert_equal @store.controller, 'users'
  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
ui_bibz-2.0.0.alpha14 test/store_test.rb
ui_bibz-2.0.0.alpha13 test/store_test.rb
ui_bibz-2.0.0.alpha12 test/store_test.rb
ui_bibz-2.0.0.alpha11 test/store_test.rb
ui_bibz-2.0.0.alpha10 test/store_test.rb
ui_bibz-2.0.0.alpha9 test/store_test.rb
ui_bibz-2.0.0.alpha8 test/store_test.rb
ui_bibz-2.0.0.alpha7 test/store_test.rb
ui_bibz-2.0.0.alpha6 test/store_test.rb
ui_bibz-2.0.0.alpha5 test/store_test.rb
ui_bibz-2.0.0.alpha4 test/store_test.rb
ui_bibz-2.0.0.alpha3 test/store_test.rb
ui_bibz-2.0.0.alpha2 test/store_test.rb
ui_bibz-2.0.0.alpha test/store_test.rb
ui_bibz-1.2.5.3 test/store_test.rb
ui_bibz-1.2.5.2 test/store_test.rb
ui_bibz-1.2.5.1 test/store_test.rb
ui_bibz-1.2.5 test/store_test.rb
ui_bibz-1.2.4 test/store_test.rb
ui_bibz-1.2.3 test/store_test.rb