Sha256: bcd123bcc68c516576c1d74b90cc6d658300f09af1275a0f88d9596c97cbe0e3

Contents?: true

Size: 764 Bytes

Versions: 6

Compression:

Stored size: 764 Bytes

Contents

require 'spec_helper'

describe GeoWorks::GeoWorksHelper do
  let(:helper) { TestingHelper.new }
  let(:presenter) { instance_double('Presenter', class: GeoWorks::ImageWorkShowPresenter) }
  before do
    class TestingHelper
      include GeoWorks::GeoWorksHelper
    end
  end
  after do
    Object.send(:remove_const, :TestingHelper)
  end

  describe '#child_geo_works_type' do
    it 'returns a the child work type name' do
      expect(helper.child_geo_works_type(presenter)).to eq 'Raster'
    end
  end

  describe '#geo_work_type' do
    before do
      allow(presenter).to receive(:human_readable_type).and_return('ImageWork')
    end

    it 'returns a the work type name' do
      expect(helper.geo_work_type(presenter)).to eq 'Image'
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
geo_works-0.2.0 spec/helpers/geo_works_helper_spec.rb
geo_works-0.1.4 spec/helpers/geo_works_helper_spec.rb
geo_works-0.1.3 spec/helpers/geo_works_helper_spec.rb
geo_works-0.1.2 spec/helpers/geo_works_helper_spec.rb
geo_works-0.1.1 spec/helpers/geo_works_helper_spec.rb
geo_works-0.1.0 spec/helpers/geo_works_helper_spec.rb