forked from bofh/fetsite
17 lines
405 B
Ruby
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
|