Commit d9f79b7b
Changed files (2)
spec
controllers
services
queries
spec/controllers/creations_controller_spec.rb
@@ -7,6 +7,7 @@ describe CreationsController do
before(:each) do
photo = File.new(File.join(Rails.root, 'spec/fixtures/images/example.png'))
creation.add_photo(photo)
+ creation.photos.first.update_attribute(:image_processing, nil)
end
describe :index do
spec/services/queries/find_all_creations_query_spec.rb
@@ -4,10 +4,15 @@ describe FindAllCreationsQuery do
let(:sut) { FindAllCreationsQuery.new }
let(:results) { sut.fetch({}) }
- let!(:cake_with_a_photo) { create(:creation, photos: [create(:photo)]) }
+ let!(:cake_with_a_photo) { create(:creation) }
let!(:cake_without_a_photo) { create(:creation, photos: []) }
let!(:restricted_cake) { create(:creation, is_restricted: true, photos: [create(:photo)]) }
+ before :each do
+ cake_with_a_photo.photos << create(:photo)
+ cake_with_a_photo.photos.first.update_attribute(:image_processing, nil)
+ end
+
it "returns all creations with at least one photo" do
results.should include(cake_with_a_photo)
end