Sha256: f72854706e7a9af0a45151165e31ce6d7cc338298c32a06866670724845a5231

Contents?: true

Size: 868 Bytes

Versions: 66

Compression:

Stored size: 868 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::VersioningService do
  describe '#latest_version_of' do
    let(:file) do
      FileSet.create do |f|
        f.apply_depositor_metadata('mjg36')
      end
    end

    before do
      # Add the original_file (this service  creates a version after saving when you call it with versioning: true)
      Hydra::Works::AddFileToFileSet.call(file, File.open(fixture_file_path('world.png')), :original_file, versioning: true)
    end

    describe 'latest_version_of' do
      subject { described_class.latest_version_of(file.original_file).label }

      context 'with one version' do
        it { is_expected.to eq 'version1' }
      end

      context 'with two versions' do
        before do
          file.original_file.create_version
        end
        it { is_expected.to eq 'version2' }
      end
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
curation_concerns-1.7.8 spec/services/versioning_service_spec.rb
curation_concerns-1.7.7 spec/services/versioning_service_spec.rb
curation_concerns-2.0.0 spec/services/versioning_service_spec.rb
curation_concerns-2.0.0.rc2 spec/services/versioning_service_spec.rb
curation_concerns-1.7.6 spec/services/versioning_service_spec.rb
curation_concerns-1.7.5 spec/services/versioning_service_spec.rb
curation_concerns-1.7.4 spec/services/versioning_service_spec.rb
curation_concerns-1.7.3 spec/services/versioning_service_spec.rb
curation_concerns-1.7.2 spec/services/versioning_service_spec.rb
curation_concerns-2.0.0.rc1 spec/services/versioning_service_spec.rb
curation_concerns-1.7.1 spec/services/versioning_service_spec.rb
curation_concerns-1.7.0 spec/services/versioning_service_spec.rb
curation_concerns-1.7.0.beta1 spec/services/versioning_service_spec.rb
curation_concerns-1.6.3 spec/services/versioning_service_spec.rb
curation_concerns-1.6.2 spec/services/versioning_service_spec.rb
curation_concerns-1.6.1 spec/services/versioning_service_spec.rb
curation_concerns-1.6.0 spec/services/versioning_service_spec.rb
curation_concerns-1.5.0 spec/services/versioning_service_spec.rb
curation_concerns-1.4.0 spec/services/versioning_service_spec.rb
curation_concerns-1.3.3 spec/services/versioning_service_spec.rb