2009-03-17 19:43:41 +01:00
|
|
|
# == Schema Information
|
|
|
|
#
|
|
|
|
# Table name: suppliers
|
|
|
|
#
|
2009-08-01 13:41:22 +02:00
|
|
|
# id :integer(4) not null, primary key
|
2009-03-17 19:43:41 +01:00
|
|
|
# name :string(255) default(""), not null
|
|
|
|
# address :string(255) default(""), not null
|
|
|
|
# phone :string(255) default(""), not null
|
|
|
|
# phone2 :string(255)
|
|
|
|
# fax :string(255)
|
|
|
|
# email :string(255)
|
|
|
|
# url :string(255)
|
|
|
|
# contact_person :string(255)
|
|
|
|
# customer_number :string(255)
|
|
|
|
# delivery_days :string(255)
|
|
|
|
# order_howto :string(255)
|
|
|
|
# note :string(255)
|
2009-08-01 13:41:22 +02:00
|
|
|
# shared_supplier_id :integer(4)
|
2009-03-17 19:43:41 +01:00
|
|
|
# min_order_quantity :string(255)
|
|
|
|
# deleted_at :datetime
|
|
|
|
#
|
|
|
|
|
2009-01-06 11:49:19 +01:00
|
|
|
require File.dirname(__FILE__) + '/../test_helper'
|
|
|
|
|
|
|
|
class SupplierTest < Test::Unit::TestCase
|
|
|
|
fixtures :suppliers
|
|
|
|
|
|
|
|
def setup
|
|
|
|
@supplier = Supplier.find_by_name("Terra")
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_read
|
|
|
|
assert_equal "Terra", @supplier.name
|
|
|
|
assert_equal "www.terra-natur.de", @supplier.url
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_update
|
|
|
|
assert_equal "tuesday", @supplier.delivery_days
|
|
|
|
@supplier.delivery_days = 'wednesday'
|
|
|
|
assert @supplier.save, @supplier.errors.full_messages.join("; ")
|
|
|
|
@supplier.reload
|
|
|
|
assert_equal 'wednesday', @supplier.delivery_days
|
|
|
|
end
|
|
|
|
end
|