foodsoft/spec/models/supplier_spec.rb

17 lines
396 B
Ruby
Raw Normal View History

require 'spec_helper'
describe Supplier do
let(:supplier) { FactoryGirl.create :supplier }
it 'has a unique name' do
supplier2 = FactoryGirl.build :supplier, name: supplier.name
2013-07-24 22:46:25 +02:00
expect(supplier2).to be_invalid
end
2013-07-15 00:17:07 +02:00
it 'has valid articles' do
supplier = FactoryGirl.create :supplier, article_count: true
2013-07-24 22:46:25 +02:00
supplier.articles.all.each {|a| expect(a).to be_valid }
2013-07-15 00:17:07 +02:00
end
end