spec/factories/raster_works.rb in geo_concerns-0.0.3 vs spec/factories/raster_works.rb in geo_concerns-0.0.4

- old
+ new

@@ -16,11 +16,11 @@ end end factory :raster_work_with_one_file do before(:create) do |raster_work, evaluator| - raster_work.ordered_members << FactoryGirl.create(:raster_file, user: evaluator.user, title: ['A GeoTIFF file'], filename: 'filename.tif') + raster_work.ordered_members << FactoryGirl.create(:raster_file, user: evaluator.user, title: ['A GeoTIFF file']) end end factory :raster_work_with_files do before(:create) do |raster_work, evaluator| @@ -33,13 +33,14 @@ image = FactoryGirl.create(:image_work, user: evaluator.user) image.ordered_members << raster_work end end - factory :raster_work_with_vector_works do + factory :raster_work_with_vector_work do after(:create) do |raster_work, evaluator| - 2.times { raster_work.ordered_members << FactoryGirl.create(:vector_work, user: evaluator.user) } + raster_work.ordered_members << FactoryGirl.create(:vector_work, user: evaluator.user) + raster_work.save end end factory :raster_work_with_one_metadata_file do after(:create) do |raster_work, evaluator| @@ -53,11 +54,12 @@ end end factory :raster_work_with_files_and_metadata_files do after(:create) do |raster_work, evaluator| - 2.times { raster_work.ordered_members << FactoryGirl.create(:raster_file, user: evaluator.user) } - 2.times { raster_work.ordered_members << FactoryGirl.create(:external_metadata_file, user: evaluator.user) } + raster_work.ordered_members << FactoryGirl.create(:raster_file, user: evaluator.user) + raster_work.ordered_members << FactoryGirl.create(:external_metadata_file, user: evaluator.user) + raster_work.save end end factory :raster_work_with_embargo_date do transient do