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,6 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :beispiel do
end
end

6
spec/factories/lvas.rb Normal file
View File

@@ -0,0 +1,6 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :lva do
end
end

View File

@@ -0,0 +1,10 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :modulgruppe do
typ "Pflicht"
phase 1
name "Pflichtmodule 1"
desc "ASDFASDF"
end
end

6
spec/factories/moduls.rb Normal file
View File

@@ -0,0 +1,6 @@
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :modul do
end
end

View File

@@ -0,0 +1,5 @@
require 'spec_helper'
describe Beispiel do
pending "add some examples to (or delete) #{__FILE__}"
end

5
spec/models/lva_spec.rb Normal file
View File

@@ -0,0 +1,5 @@
require 'spec_helper'
describe Lva do
pending "add some examples to (or delete) #{__FILE__}"
end

View File

@@ -0,0 +1,5 @@
require 'spec_helper'
describe Modul do
pending "add some examples to (or delete) #{__FILE__}"
end

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