Sha256: d0591fdf7bb19183c7a0b5a4112ad317935c542251b7af75c60eb713c3bd9bbd

Contents?: true

Size: 925 Bytes

Versions: 66

Compression:

Stored size: 925 Bytes

Contents

require 'spec_helper'

describe CurationConcerns::VersionListPresenter, :no_clean do
  let(:resource_version) do
    ActiveFedora::VersionsGraph::ResourceVersion.new.tap do |v|
      v.uri = 'http://example.com/version1'
      v.label = 'version1'
      v.created = '2014-12-09T02:03:18.296Z'
    end
  end

  let(:resource_version2) do
    ActiveFedora::VersionsGraph::ResourceVersion.new.tap do |v|
      v.uri = 'http://example.com/version2'
      v.label = 'version2'
      v.created = '2014-12-19T02:03:18.296Z'
    end
  end

  subject { described_class.new([resource_version, resource_version2]) }

  describe "#each" do
    it "yields version_presenters" do
      versions_descending = []
      subject.each do |v|
        expect(v).to be_kind_of CurationConcerns::VersionPresenter
        versions_descending.push(v.label)
      end
      expect(versions_descending).to eq ['version2', 'version1']
    end
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

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