forked from bofh/fetsite
Merge branch 'master' of https://github.com/fetsite/fetsite
Conflicts: app/views/layouts/menu.html.erb config/routes.rb
This commit is contained in:
5
spec/models/calendar_spec.rb
Normal file
5
spec/models/calendar_spec.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Calendar do
|
||||
pending "add some examples to (or delete) #{__FILE__}"
|
||||
end
|
||||
20
spec/models/calentry_spec.rb
Normal file
20
spec/models/calentry_spec.rb
Normal file
@@ -0,0 +1,20 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe Calentry do
|
||||
it "should be valid with full data" do
|
||||
e = FactoryGirl.build(:calentry)
|
||||
c = FactoryGirl.create(:calendar)
|
||||
e.calendars<<c
|
||||
e.should be_valid
|
||||
end
|
||||
[:ende,:start,:typ].each do |attr|
|
||||
it "should not be valid without #{attr}" do
|
||||
e= FactoryGirl.build(:calentry, attr => nil)
|
||||
c=FactoryGirl.create(:calendar)
|
||||
e.calendars<<c
|
||||
e.should_not be_valid
|
||||
e.should have_at_least(1).errors_on(attr)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user