Sha256: 3fefc2faf227f89ae6a28ff30a49c3442cf52f901bebd20d289cc7220b2616b8

Contents?: true

Size: 1.02 KB

Versions: 11

Compression:

Stored size: 1.02 KB

Contents

require 'spec_helper'

describe GeoConcerns::GeoWorksHelper do
  let(:helper) { TestingHelper.new }
  let(:show_presenter) { instance_double('ShowPresenter', class: GeoConcerns::GeoConcernsShowPresenter) }
  let(:file_presenter) { instance_double('FilePresenter', class: CurationConcerns::FileSetPresenter) }
  let(:file_presenters) { [file_presenter] }
  before do
    class TestingHelper
      include GeoConcerns::PopulateMetadataHelper

      def curation_concern
      end
    end
  end
  after do
    Object.send(:remove_const, :TestingHelper)
  end

  describe '#external_metadata_file_presenters' do
    before do
      allow(GeoConcerns::GeoConcernsShowPresenter).to receive(:new).and_return(show_presenter)
    end

    it 'returns an array of external_metadata_file_presenters' do
      expect(show_presenter).to receive(:external_metadata_file_set_presenters).and_return(file_presenters)
      expect(helper).to receive(:curation_concern)
      expect(helper.external_metadata_file_presenters).to eq(file_presenters)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
geo_concerns-0.3.4 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.3.3 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.3.2 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.3.1 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.3.0 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.2.0 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.1.1 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.1.0 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.0.10 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.0.9 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb
geo_concerns-0.0.8 spec/helpers/geo_concerns/populate_metadata_helper_spec.rb