forked from bofh/fetsite
THEMA TESTS
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Read about factories at https://github.com/thoughtbot/factory_girl
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
||||||
|
|
||||||
FactoryGirl.define do
|
FactoryGirl.define do
|
||||||
factory :themagruppen, :class => 'Themengruppe' do
|
factory :themengruppe, :class => 'Themengruppe' do
|
||||||
title "MyString"
|
title "MyString"
|
||||||
text "MyText"
|
text "MyText"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,21 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Thema do
|
describe Thema do
|
||||||
pending "add some examples to (or delete) #{__FILE__}"
|
|
||||||
|
[:text, :title].each do |attr|
|
||||||
|
it "should not be valid without #{attr}" do
|
||||||
|
tg=FactoryGirl.build(:themengruppe)
|
||||||
|
t = FactoryGirl.build(:thema, attr=>nil)
|
||||||
|
t.themengruppe=tg
|
||||||
|
t.should_not be_valid
|
||||||
|
end
|
||||||
|
end
|
||||||
|
it "should not be valid without Themengruppe" do
|
||||||
|
tg=FactoryGirl.build(:themengruppe)
|
||||||
|
t = FactoryGirl.build(:thema)
|
||||||
|
t.should_not be_valid
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe Themengruppe do
|
describe Themengruppe do
|
||||||
pending "add some examples to (or delete) #{__FILE__}"
|
[:text, :title].each do |attr|
|
||||||
|
it "should not be valid without #{attr}" do
|
||||||
|
tg=FactoryGirl.build(:themengruppe, attr=>nil)
|
||||||
|
tg.should_not be_valid
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user