Added factories and spec files for Beispielsammlung

This commit is contained in:
2013-07-26 02:57:30 +02:00
parent eeae723994
commit 8eabea255e
8 changed files with 59 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
require 'spec_helper'
describe Modulgruppe do
it "modulgruppe should not be valid without studium" do
mg=FactoryGirl.build(:modulgruppe)
mg.should_not be_valid
mg.should have(1).errors_on(:studium_id)
end
it "modulgruppe should be valid with studium" do
s=FactoryGirl.create(:studium)
mg=FactoryGirl.build(:modulgruppe)
mg.studium=s
mg.should be_valid
end
end