AutoCommit Sam Sep 5 21:03:02 CEST 2015
This commit is contained in:
@@ -7,8 +7,5 @@ FactoryGirl.define do
|
|||||||
name "Kommission"
|
name "Kommission"
|
||||||
desc "Das ist eine Kommission die sich mit irgendwas beschäftigt"
|
desc "Das ist eine Kommission die sich mit irgendwas beschäftigt"
|
||||||
typ 1
|
typ 1
|
||||||
factory :gremium_with_fetprofile do
|
|
||||||
association :memberships, factory: :membership_with_fetprofile
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,15 +2,11 @@
|
|||||||
|
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :membership do
|
factory :membership do
|
||||||
|
gremium_id 1
|
||||||
|
fetprofile_id 1
|
||||||
start "2013-08-19"
|
start "2013-08-19"
|
||||||
stop "2013-08-23"
|
stop "2013-08-23"
|
||||||
typ 1
|
typ 1
|
||||||
factory :membership_with_fetprofile do
|
|
||||||
association :fetprofile
|
|
||||||
end
|
|
||||||
factory :membership_with_gremium do
|
|
||||||
association :gremium
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -25,15 +25,16 @@ describe Gremium do
|
|||||||
expect(Gremium.tabs).to eq([])
|
expect(Gremium.tabs).to eq([])
|
||||||
end
|
end
|
||||||
it "destroys memberships if its destroyed" do
|
it "destroys memberships if its destroyed" do
|
||||||
g=FactoryGirl.create(:gremium_with_fetprofile)
|
g=FactoryGirl.create(:gremium)
|
||||||
expect(Membership.count).to be(1)
|
fp=FactoryGirl.create(:fetprofile)
|
||||||
g.delete
|
m=FactoryGirl.create(:membership, gremium_id: g.id, fetprofile_id: fp.id)
|
||||||
expect(Membership.count).to be(0)
|
expect{g.destroy}.to change {Membership.count}.by(-1)
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it "responds to title" do
|
it "responds to title" do
|
||||||
g=FactoryGirl.build(:gremium)
|
g=FactoryGirl.build(:gremium)
|
||||||
expect(g.responds_to?(:title)).to be true
|
expect(g.respond_to?(:title)).to be true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user