Sha256: 0bc1e3a4e9d5b2cd90f38ba23011b71deb4bd3a2e62973ddce64a11997bfaec0

Contents?: true

Size: 1.17 KB

Versions: 17

Compression:

Stored size: 1.17 KB

Contents

require 'test_helper'

class CheckboxTest < ViewCase

  setup :sign_in
  teardown :teardown

  def test_checkboxes_with_active_record_collection
    # test permission, which proc in options gives an
    # activerecord array as a response.

    visit adminpanel.new_role_path

    checkbox_container = find('#permission-relation')

    assert checkbox_container.find('label > label', text: 'Publisher: ')
    assert checkbox_container.find('label > label', text: 'Creator: ')
    assert checkbox_container.find('label > label', text: 'Updater: ')
    assert checkbox_container.find('label > label', text: 'Reader: ')
    assert checkbox_container.find('label > label', text: 'Deleter: ')
  end

  def test_checkboxes_with_mapped_result
    # test select, with proc in options gives an
    # [['one', '1'], ['two', '2'], ...] as a repsonse (map)
    # visit adminpanel.new_salesman_path
    # select_field = find('#salesman_product_id')
    # assert select_field
    # assert select_field.find('option', text: 'SuperProduct saved')
    # assert select_field.find('option', text: 'SuperProduct with limit')
  end

  private
    def sign_in
      visit adminpanel.signin_path
      login
    end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
adminpanel-3.6.1 test/features/shared/form/checkbox_test.rb
adminpanel-3.6.0 test/features/shared/form/checkbox_test.rb
adminpanel-3.5.1 test/features/shared/form/checkbox_test.rb
adminpanel-3.5.0 test/features/shared/form/checkbox_test.rb
adminpanel-3.4.7 test/features/shared/form/checkbox_test.rb
adminpanel-3.4.6 test/features/shared/form/checkbox_test.rb
adminpanel-3.4.5 test/features/shared/form/checkbox_test.rb
adminpanel-3.4.4 test/features/shared/form/checkbox_test.rb
adminpanel-3.4.3 test/features/shared/form/checkbox_test.rb
adminpanel-3.4.2 test/features/shared/form/checkbox_test.rb
adminpanel-3.4.1 test/features/shared/form/checkbox_test.rb
adminpanel-3.4.0 test/features/shared/form/checkbox_test.rb
adminpanel-3.3.4 test/features/shared/form/checkbox_test.rb
adminpanel-3.3.3 test/features/shared/form/checkbox_test.rb
adminpanel-3.3.0 test/features/shared/form/checkbox_test.rb
adminpanel-3.2.1 test/features/shared/form/checkbox_test.rb
adminpanel-3.2.0 test/features/shared/form/checkbox_test.rb