Sha256: 90cfbd15df150afbb67bbfbefb5a29220f5c318586ec11b9135002e1b9bd68f4

Contents?: true

Size: 1.08 KB

Versions: 17

Compression:

Stored size: 1.08 KB

Contents

require 'test_helper'

class HasManyThroughRemoteTest < ViewCase

  setup :visit_adminpanel_new_department_path
  teardown :teardown

  def test_add_remote_product_link_exist
    assert_link('Agregar Producto')
  end

  def test_adding_a_remote_product_with_invalid_information
    trigger_modal 'Agregar Producto'
    assert_equal 'Agregar Producto', find('#modal-title').text
    submit_modal 'Agregar Producto'
    assert_content( I18n.t('errors', model: 'Producto', count: 3) )
  end

  def test_adding_a_remote_product_with_valid_information
    trigger_modal 'Agregar Producto'
    fill_in 'product_name', with: 'remote checkbox of product'

    page.execute_script(
      %Q(
        var editor = $('#description-trix-editor')[0].editor;
        editor.insertString("Hello");
      )
    ) # to fill the wysiwyg editor

    fill_in 'product_price', with: '12.3'
    submit_modal 'Agregar Producto'
    assert_content 'remote checkbox of product'
  end

  private

  def visit_adminpanel_new_department_path
    visit adminpanel.signin_path
    login
    visit adminpanel.new_department_path
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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