diff --git a/spec/models/neuigkeit_spec.rb b/spec/models/neuigkeit_spec.rb new file mode 100644 index 0000000..73f07ba --- /dev/null +++ b/spec/models/neuigkeit_spec.rb @@ -0,0 +1,31 @@ +require 'spec_helper' + +describe Neuigkeit do + let(:rubrik) {FactoryGirl.create(:rubrik)} + let(:user) {FactoryGirl.create(:user)} + [:title,:text, :rubrik_id].each do |attr| + it "should not be valid without #{attr}" do + fp = FactoryGirl.build(:fetprofile) + fp.send("#{attr}=".to_sym,nil) + fp.should_not be_valid + end + end + it "should be created" do + + fp=Fetprofile.new(FactoryGirl.attributes_for(:neuigkeit, rubrik_id: rubrik.id, author_id: user.id)) + expect(fp.save).to be true + end + + it "should be valid" do + fp = FactoryGirl.build(:neuigkeit, rubrik_id: rubrik.id, author_id: user.id) + fp.should be_valid + end + pending "is parent for attachments " + pending "has questions" + pending "has nlinks" + pending "has calentries" + pending "can be an event" + pending "is published by date" + pending "has meeting" + pending "is shareable" +end