Sha256: 300b9f14e85b031c4bdbd70bf01bdeafaf1b1f68dac048b9917d5b5b6d298bdf

Contents?: true

Size: 1.26 KB

Versions: 17

Compression:

Stored size: 1.26 KB

Contents

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

class BelongsToNonCategoryModalTest < ViewCase

  setup :visit_adminpanel_new_salesman_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 product'
    fill_in 'product_description', with: 'remote description lorem'
    fill_in 'product_price', with: '12.3'
    submit_modal 'Agregar Producto'
    # remote_product = Adminpanel::Product.last
    # assert_equal 'remote_product', remote_product.name
    # assert_equal 'remote descrpition lorem', remote_product.description
    # assert_equal '12.3', remote_product.price
    assert_xpath("//option[contains(text(), 'remote product' )]")
  end

  private

  def visit_adminpanel_new_salesman_path
    visit adminpanel.signin_path
    login
    visit adminpanel.new_salesman_path
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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