diff --git a/spec/factories/attachments.rb b/spec/factories/attachments.rb index 9c31968..4bec5f0 100644 --- a/spec/factories/attachments.rb +++ b/spec/factories/attachments.rb @@ -3,5 +3,7 @@ FactoryGirl.define do factory :attachment do name "MyString" + datei { Rack::Test::UploadedFile.new(File.join(Rails.root,'public','fetlogo.png'))} + flag_titlepic false end end diff --git a/spec/models/attachment_spec.rb b/spec/models/attachment_spec.rb index 9981316..0cfdd37 100644 --- a/spec/models/attachment_spec.rb +++ b/spec/models/attachment_spec.rb @@ -2,4 +2,9 @@ require 'spec_helper' describe Attachment do pending "add some examples to (or delete) #{__FILE__}" + let(:attachment) {FactoryGirl.build_stubbed(:attachment)} + it "responds to image" do + expect(attachment.respond_to?(:image?)).to be true + end + end diff --git a/spec/models/beispiel_spec.rb b/spec/models/beispiel_spec.rb index cf86e80..171456e 100644 --- a/spec/models/beispiel_spec.rb +++ b/spec/models/beispiel_spec.rb @@ -18,7 +18,6 @@ describe Beispiel, :type=>:model do let(:beispiel){FactoryGirl.build(:beispiel, lva: lva)} it "should be created" do - expect{beispiel.save!; Sunspot.commit}.to change{Beispiel.count}.by(1) end it "is not valid without lva" do