Sha256: 8dd1789849eb55593ff97ebfbdff106cd48c1136f707cfd9dbbc808daaa98922

Contents?: true

Size: 1.34 KB

Versions: 20

Compression:

Stored size: 1.34 KB

Contents

require 'test_helper'

class TablesHelperTest < ActionView::TestCase
  include RailsDb::TablesHelper

  test "method column_is_checked? returns true for checkbox status if cookie does not contain hash_key for this table" do
    status = column_is_checked?('users', 'created_at')
    assert_equal true, status
  end

  test "method column_is_checked? returns true for checkbox status if cookie does not contain record for this table:column" do
    cookies['Table: users'] = 'created_at,'
    status = column_is_checked?('users', 'name')
    assert_equal true, status
  end

  test "method column_is_checked? returns false for checkbox status if cookie contains record for this table:column" do
    cookies['Table: users'] = 'created_at,'
    status = column_is_checked?('users', 'created_at')
    assert_equal false, status
  end

  test "method display_style_column returns 'display:none' if cookie contains record for this table:column" do
    cookies['Table: users'] = 'created_at,'
    style = display_style_column('users', 'created_at')
    assert_equal 'display:none', style
  end

  test "method display_style_column returns 'display' if cookie does not contain record for this table:column" do
    cookies['Table: users'] = 'created_at,'
    style = display_style_column('users', 'name')
    assert_equal 'display', style
  end

end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
rails_db-2.4.5 test/tables_helper_test.rb
rails_db-2.4.4 test/tables_helper_test.rb
rails_db-2.4.3 test/tables_helper_test.rb
rails_db-2.4.2 test/tables_helper_test.rb
rails_db-2.4.1 test/tables_helper_test.rb
rails_db-2.4.0 test/tables_helper_test.rb
rails_db-2.3.1 test/tables_helper_test.rb
rails_db-2.3.0 test/tables_helper_test.rb
rails_db-2.2.1 test/tables_helper_test.rb
rails_db-2.2.0 test/tables_helper_test.rb
rails_db-2.1.1 test/tables_helper_test.rb
rails_db-2.1.0 test/tables_helper_test.rb
rails_db-2.0.6 test/tables_helper_test.rb
rails_db-2.0.5 test/tables_helper_test.rb
rails_db-2.0.4 test/tables_helper_test.rb
xplore-0.0.1.alpha test/tables_helper_test.rb
rails_db-2.0.3 test/tables_helper_test.rb
rails_db-2.0.2 test/tables_helper_test.rb
rails_db-2.0.1 test/tables_helper_test.rb
rails_db-2.0.0 test/tables_helper_test.rb