Sha256: af78ce85caa88fd2d1febb6f0e79993a095e0f25b01ad390d722692018c53760

Contents?: true

Size: 971 Bytes

Versions: 21

Compression:

Stored size: 971 Bytes

Contents

FactoryGirl.define do
  factory :raster_file, class: FileSet do
    initialize_with { new(geo_mime_type: 'image/tiff; gdal-format=GTiff') }
    transient do
      user { FactoryGirl.create(:user) }
      content nil

      cartographic_projection 'urn:ogc:def:crs:EPSG::6326'
    end

    after(:build) do |file, evaluator|
      file.apply_depositor_metadata(evaluator.user.user_key)
    end

    after(:create) do |file, evaluator|
      if evaluator.content
        Hydra::Works::UploadFileToFileSet.call(file, evaluator.content)
      end
    end

    factory :raster_file_with_raster do
      # after(:build) do |file, evaluator|
      #  file.title = ['testfile']
      # end
      after(:create) do |file, evaluator|
        if evaluator.content
          Hydra::Works::UploadFileToFileSet.call(file, evaluator.content)
        end

        raster = FactoryGirl.create(:raster, user: evaluator.user)
        raster.raster_files << file
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
geo_works-0.2.0 spec/factories/raster_files.rb
geo_works-0.1.4 spec/factories/raster_files.rb
geo_works-0.1.3 spec/factories/raster_files.rb
geo_works-0.1.2 spec/factories/raster_files.rb
geo_works-0.1.1 spec/factories/raster_files.rb
geo_works-0.1.0 spec/factories/raster_files.rb
geo_concerns-0.3.4 spec/factories/raster_files.rb
geo_concerns-0.3.3 spec/factories/raster_files.rb
geo_concerns-0.3.2 spec/factories/raster_files.rb
geo_concerns-0.3.1 spec/factories/raster_files.rb
geo_concerns-0.3.0 spec/factories/raster_files.rb
geo_concerns-0.2.0 spec/factories/raster_files.rb
geo_concerns-0.1.1 spec/factories/raster_files.rb
geo_concerns-0.1.0 spec/factories/raster_files.rb
geo_concerns-0.0.10 spec/factories/raster_files.rb
geo_concerns-0.0.9 spec/factories/raster_files.rb
geo_concerns-0.0.8 spec/factories/raster_files.rb
geo_concerns-0.0.7 spec/factories/raster_files.rb
geo_concerns-0.0.6 spec/factories/raster_files.rb
geo_concerns-0.0.5 spec/factories/raster_files.rb