forked from bofh/fetsite
AutoCommit Sam Sep 12 12:03:06 CEST 2015
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Modul do
|
||||
it "should not be valid without name" do
|
||||
m = FactoryGirl.build(:modul)
|
||||
m.should_not be_valid
|
||||
m.should have(1).errors_on(:name)
|
||||
[: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 "should be valid with name" do
|
||||
it "is valid with everything" do
|
||||
m = FactoryGirl.build(:modul)
|
||||
m.name = "Grundlagen"
|
||||
m.should be_valid
|
||||
expect(m).to be_valid
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user