AutoCommit Mon Sep 14 01:03:01 CEST 2015
This commit is contained in:
@@ -6,5 +6,11 @@ describe Attachment do
|
|||||||
it "responds to image" do
|
it "responds to image" do
|
||||||
expect(attachment.respond_to?(:image?)).to be true
|
expect(attachment.respond_to?(:image?)).to be true
|
||||||
end
|
end
|
||||||
|
it "is an image" do
|
||||||
|
expect(attachment.image?).to be true
|
||||||
|
end
|
||||||
|
it "is valid" do
|
||||||
|
expect(attachment).to be_valid
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ describe Neuigkeit do
|
|||||||
let(:rubrik) {FactoryGirl.create(:rubrik)}
|
let(:rubrik) {FactoryGirl.create(:rubrik)}
|
||||||
let(:user) {FactoryGirl.create(:user)}
|
let(:user) {FactoryGirl.create(:user)}
|
||||||
let(:neuigkeit) {(FactoryGirl.build(:neuigkeit, rubrik_id: rubrik.id, author_id: user.id))}
|
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|
|
[:title,:text, :rubrik, :author].each do |attr|
|
||||||
it "should not be valid without #{attr}" do
|
it "should not be valid without #{attr}" do
|
||||||
neuigkeit.send("#{attr}=".to_sym,nil)
|
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)
|
fp = FactoryGirl.build(:neuigkeit, rubrik_id: rubrik.id, author_id: user.id)
|
||||||
expect(fp).to be_valid
|
expect(fp).to be_valid
|
||||||
end
|
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 questions"
|
||||||
pending "has nlinks"
|
pending "has nlinks"
|
||||||
pending "has calentries"
|
pending "has calentries"
|
||||||
|
|||||||
Reference in New Issue
Block a user