Sha256: 654e4a8c68c5835cfb33b839244bc03842397ccd5d914928b406bf056821b0fe

Contents?: true

Size: 1.18 KB

Versions: 6

Compression:

Stored size: 1.18 KB

Contents

require 'test_helper'

class CheckboxTest < ViewCase
  fixtures :all

  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

6 entries across 6 versions & 1 rubygems

Version Path
adminpanel-3.1.0 test/features/shared/form/checkbox_test.rb
adminpanel-3.0.0 test/features/shared/form/checkbox_test.rb
adminpanel-2.6.1 test/features/shared/form/checkbox_test.rb
adminpanel-2.6.0 test/features/shared/form/checkbox_test.rb
adminpanel-2.5.5 test/features/shared/form/checkbox_test.rb
adminpanel-2.5.4 test/features/shared/form/checkbox_test.rb