foodsoft/test/unit/supplier_test.rb

24 lines
574 B
Ruby
Raw Normal View History

2009-01-06 11:49:19 +01:00
require File.dirname(__FILE__) + '/../test_helper'
2013-06-25 13:04:55 +02:00
class SupplierTest < ActiveSupport::TestCase
2009-01-06 11:49:19 +01:00
fixtures :suppliers
def setup
@supplier = Supplier.find_by_name("Terra")
end
2013-06-25 13:04:55 +02:00
test 'read' do
2009-01-06 11:49:19 +01:00
assert_equal "Terra", @supplier.name
assert_equal "www.terra-natur.de", @supplier.url
end
2013-06-25 13:04:55 +02:00
test 'update' do
2009-01-06 11:49:19 +01:00
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