AutoCommit Mon Sep 14 01:03:01 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-09-14 01:03:01 +02:00
parent a47c6fea7a
commit 168b4d9e4c
2 changed files with 22 additions and 2 deletions

View File

@@ -6,5 +6,11 @@ describe Attachment do
it "responds to image" do
expect(attachment.respond_to?(:image?)).to be true
end
it "is an image" do
expect(attachment.image?).to be true
end
it "is valid" do
expect(attachment).to be_valid
end
end

View File

@@ -4,6 +4,8 @@ describe Neuigkeit do
let(:rubrik) {FactoryGirl.create(:rubrik)}
let(:user) {FactoryGirl.create(:user)}
let(:neuigkeit) {(FactoryGirl.build(:neuigkeit, rubrik_id: rubrik.id, author_id: user.id))}
let(:attachment) {FactoryGirl.build_stubbed(:attachment)}
[:title,:text, :rubrik, :author].each do |attr|
it "should not be valid without #{attr}" do
neuigkeit.send("#{attr}=".to_sym,nil)
@@ -20,7 +22,19 @@ describe Neuigkeit do
fp = FactoryGirl.build(:neuigkeit, rubrik_id: rubrik.id, author_id: user.id)
expect(fp).to be_valid
end
pending "is parent for attachments "
it "responds to attachments" do
expect(neuigkeit.respond_to?(:attachments)).to be true
end
it "uses titlepic attachments as picture" do
expect(neuigkeit.respond_to?(:picture_robust)).to be true
attachment.flag_titlepic = true
expect { neuigkeit.attachments << attachment }.to change {neuigkeit.picture_robust}
end
it "is an event if it has a calentry" do
expect(neuigkeit.event?).to be false
expect{neuigkeit.calentries << calentry}.to change(neuigkeit, :event?)
end
pending "has questions"
pending "has nlinks"
pending "has calentries"