Sha256: e7490ce69b0a9c10359e0fc8aeb121177b3b7e72cd5e6d2cddc5092cdfc95fdc

Contents?: true

Size: 886 Bytes

Versions: 14

Compression:

Stored size: 886 Bytes

Contents

require 'spec_helper'

RSpec.feature "Multi select", type: :feature do
  scenario "Selecting all", js: true do
    Employee.create name: 'E1', section: 'ABC', admin: true, vegan: false
    Employee.create name: 'E2', section: 'QNP', admin: false, vegan: false
    visit employees_path
    find('.selection-toggle-all').click
    find('.actions-button').click

    page.should have_selector ".optional-input-activator-container.section.inactive"
    page.should_not have_selector ".optional-attribute-container.section" # hidden
    page.should have_selector ".optional-attribute-container.admin.inactive"
    page.should have_selector ".optional-attribute-container.vegan.active"

    # Activate admin, and see that they all become false
    find('.admin .optional-boolean-activator-toggle').click
    find('[name="commit"]').click

    Employee.pluck(:admin).should be_none

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
record_collection-0.6.0 spec/features/multi_select_spec.rb
record_collection-0.5.3 spec/features/multi_select_spec.rb
record_collection-0.5.2 spec/features/multi_select_spec.rb
record_collection-0.5.1 spec/features/multi_select_spec.rb
record_collection-0.5.0 spec/features/multi_select_spec.rb
record_collection-0.4.6 spec/features/multi_select_spec.rb
record_collection-0.4.5 spec/features/multi_select_spec.rb
record_collection-0.4.4 spec/features/multi_select_spec.rb
record_collection-0.4.3 spec/features/multi_select_spec.rb
record_collection-0.4.2 spec/features/multi_select_spec.rb
record_collection-0.4.1 spec/features/multi_select_spec.rb
record_collection-0.4.0 spec/features/multi_select_spec.rb
record_collection-0.3.3 spec/features/multi_select_spec.rb
record_collection-0.3.2 spec/features/multi_select_spec.rb