forked from bofh/fetsite
Added factories and spec files for Beispielsammlung
This commit is contained in:
6
spec/factories/beispiele.rb
Normal file
6
spec/factories/beispiele.rb
Normal 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
6
spec/factories/lvas.rb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :lva do
|
||||||
|
end
|
||||||
|
end
|
||||||
10
spec/factories/modulgruppen.rb
Normal file
10
spec/factories/modulgruppen.rb
Normal 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
6
spec/factories/moduls.rb
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
|
FactoryGirl.define do
|
||||||
|
factory :modul do
|
||||||
|
end
|
||||||
|
end
|
||||||
5
spec/models/beispiel_spec.rb
Normal file
5
spec/models/beispiel_spec.rb
Normal 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
5
spec/models/lva_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Lva do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
5
spec/models/modul_spec.rb
Normal file
5
spec/models/modul_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe Modul do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
||||||
16
spec/models/modulgruppe_spec.rb
Normal file
16
spec/models/modulgruppe_spec.rb
Normal 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
|
||||||
Reference in New Issue
Block a user