Sha256: 148fdebe4d595c07f2a8cc5b7db2c02f089b767984c9d65697fd6186b13201bc

Contents?: true

Size: 950 Bytes

Versions: 17

Compression:

Stored size: 950 Bytes

Contents

require 'test_helper'
require 'adminpanel/product'
require 'adminpanel/category'

class HasManyThroughCategoryModalTest < ViewCase

  setup :visit_adminpanel_new_product_path
  teardown :teardown

  def test_add_remote_product_link_exist
    assert_link('Agregar Categoria')
  end

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

  def test_adding_a_remote_product_with_valid_information
    trigger_modal 'Agregar Categoria'
    fill_in 'category_name', with: 'remote option of category'
    submit_modal 'Agregar Categoria'
    assert_content('remote option of category')
  end

  private

  def visit_adminpanel_new_product_path
    visit adminpanel.signin_path
    login
    visit adminpanel.new_product_path
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
adminpanel-2.4.3 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.4.2 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.4.1 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.4.0 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.3.1 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.3.0 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.2.5 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.2.4 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.2.3 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.2.2 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.2.1 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.2.0 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.1.7 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.1.6 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.1.5 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.1.3 test/features/shared/form/has_many_through_category_modal_test.rb
adminpanel-2.1.2 test/features/shared/has_many_through_category_modal_test.rb