AutoCommit Sam Sep 12 12:03:06 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-09-12 12:03:06 +02:00
parent cfb42584e1
commit 3d87ce6fd2
5 changed files with 36 additions and 36 deletions

View File

@@ -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