Sha256: 14559f061a7a386e03c8377494563a3eb55bd39fce1b28e5481c01a82bd137f2

Contents?: true

Size: 1 KB

Versions: 3

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe Sufia::CollectionPresenter do
  describe ".terms" do
    subject { described_class.terms }
    it { is_expected.to eq [:title, :total_items, :size, :resource_type, :description, :creator,
                            :contributor, :tag, :rights, :publisher, :date_created, :subject,
                            :language, :identifier, :based_near, :related_url] }
  end

  let(:collection) { Collection.new(description: 'a nice collection', title: 'A clever title') }
  let(:presenter) { described_class.new(collection) }

  describe "#terms_with_values" do
    subject { presenter.terms_with_values }

    it { is_expected.to eq [:title, :total_items, :size, :description] }
  end

  describe "#title" do
    subject { presenter.title }
    it { is_expected.to eq 'A clever title' }
  end

  describe "#size" do
    subject { presenter.size }
    it { is_expected.to eq '0 Bytes' }
  end

  describe "#total_items" do
    subject { presenter.total_items }
    it { is_expected.to eq 0 }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sufia-6.0.0 spec/presenters/sufia/collection_presenter_spec.rb
sufia-6.0.0.rc4 spec/presenters/sufia/collection_presenter_spec.rb
sufia-6.0.0.rc3 spec/presenters/sufia/collection_presenter_spec.rb