Files
fetsite/spec/models/modul_spec.rb
2015-09-12 12:03:06 +02:00

17 lines
405 B
Ruby

require 'spec_helper'
describe Modul do
[:name].each do |attr|
it "should not be valid without #{attr}" do
modul = FactoryGirl.build(:modul)
modul.send("#{attr}=".to_sym,nil)
expect(modul).not_to be_valid
expect(modul).to have_at_least(1).errors_on(attr)
end
end
it "is valid with everything" do
m = FactoryGirl.build(:modul)
expect(m).to be_valid
end
end