Sha256: 05663e4fdb51058fdd2692c68b90938d7c7c7886f5999ac1f4cb3279e8e9f7b4

Contents?: true

Size: 1.03 KB

Versions: 1

Compression:

Stored size: 1.03 KB

Contents

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

class BelongsToRemoteTest < 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'

    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

1 entries across 1 versions & 1 rubygems

Version Path
adminpanel-3.0.0 test/features/shared/form/belongs_to_remote_test.rb