Sha256: 641cbdce40a4d34ba5282c5362c11c37f34ae2b31aacf952dcfb49970488da34

Contents?: true

Size: 1.17 KB

Versions: 18

Compression:

Stored size: 1.17 KB

Contents

module CharacterRestArrayTest

  def urlParams(factory_name, class_name, list_of_modules, config)
    test 'Select Items Only From Scope' do
      create_n_objects(20, factory_name)
      visit('/admin')
      wait_for_ajax
      select_last_module_from_list(list_of_modules)
      assert page.has_css?('div.item-title', count: config[:urlParams].count)
      config[:urlParams].each do |article|
        assert page.has_css?("a[data-id='#{article.id}']")
      end
    end
  end


  def remove_from_scope(factory_name, class_name, list_of_modules, config)
    test 'Remove From Scope' do
      create_n_objects(20, factory_name)
      first_element_from_scope = config[:urlParams].first
      count_elements_in_scope_before = config[:urlParams].count
      show_form_of_item(list_of_modules, first_element_from_scope.id)
      find('label.input-description textarea').set("New sports diet")
      find_link('Save').click
      wait_for_ajax
      # Reload page
      visit('/admin')
      select_last_module_from_list(list_of_modules)
      assert_not page.has_content?('New sports diet')
      assert page.has_css?('div.item-title', count: count_elements_in_scope_before-1)
    end
  end

end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
chr-0.5.1 test/support/stores/rest-array.rb
chr-0.5.0 test/support/stores/rest-array.rb
chr-0.4.25 test/support/stores/rest-array.rb
chr-0.4.24 test/support/stores/rest-array.rb
chr-0.4.23 test/support/stores/rest-array.rb
chr-0.4.22 test/support/stores/rest-array.rb
chr-0.4.21 test/support/stores/rest-array.rb
chr-0.4.20 test/support/stores/rest-array.rb
chr-0.4.19 test/support/stores/rest-array.rb
chr-0.4.18 test/support/stores/rest-array.rb
chr-0.4.17 test/support/stores/rest-array.rb
chr-0.4.15 test/support/stores/rest-array.rb
chr-0.4.14 test/support/stores/rest-array.rb
chr-0.4.13 test/support/stores/rest-array.rb
chr-0.4.12 test/support/stores/rest-array.rb
chr-0.4.11 test/support/stores/rest-array.rb
chr-0.4.10 test/support/stores/rest-array.rb
chr-0.4.9 test/support/stores/rest-array.rb