Sha256: 1e3f8bded1d044f1131d9ca1838e033683f6eee8fc3c682efb0057fca8f89a81

Contents?: true

Size: 897 Bytes

Versions: 21

Compression:

Stored size: 897 Bytes

Contents

FactoryGirl.define do
  factory :vector_file, class: FileSet do
    initialize_with { new(geo_mime_type: 'application/zip; ogr-format="ESRI Shapefile"') }
    transient do
      user { FactoryGirl.create(:user) }
      content nil
    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 :vector_file_with_vector 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
        FactoryGirl.create(:vector, user: evaluator.user).vector_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/vector_files.rb
geo_works-0.1.4 spec/factories/vector_files.rb
geo_works-0.1.3 spec/factories/vector_files.rb
geo_works-0.1.2 spec/factories/vector_files.rb
geo_works-0.1.1 spec/factories/vector_files.rb
geo_works-0.1.0 spec/factories/vector_files.rb
geo_concerns-0.3.4 spec/factories/vector_files.rb
geo_concerns-0.3.3 spec/factories/vector_files.rb
geo_concerns-0.3.2 spec/factories/vector_files.rb
geo_concerns-0.3.1 spec/factories/vector_files.rb
geo_concerns-0.3.0 spec/factories/vector_files.rb
geo_concerns-0.2.0 spec/factories/vector_files.rb
geo_concerns-0.1.1 spec/factories/vector_files.rb
geo_concerns-0.1.0 spec/factories/vector_files.rb
geo_concerns-0.0.10 spec/factories/vector_files.rb
geo_concerns-0.0.9 spec/factories/vector_files.rb
geo_concerns-0.0.8 spec/factories/vector_files.rb
geo_concerns-0.0.7 spec/factories/vector_files.rb
geo_concerns-0.0.6 spec/factories/vector_files.rb
geo_concerns-0.0.5 spec/factories/vector_files.rb