Sha256: 2d789193509321098f767483eb2ea1ea2826666ce0435e8a523cc31bbc5ecb31

Contents?: true

Size: 986 Bytes

Versions: 6

Compression:

Stored size: 986 Bytes

Contents

require 'spec_helper'

describe GeoWorks::BoundingBoxHelper do
  let(:property) { :coverage }
  let(:helper) { TestingHelper.new }
  before do
    class TestingHelper
      include GeoWorks::BoundingBoxHelper

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

  before do
    vector_work = instance_double('vector_work', class: VectorWork)
    allow(helper).to receive(:curation_concern).and_return(vector_work)
  end

  describe '#bbox' do
    it 'builds bounding box selector' do
      expect(helper.bbox(property)).to include("{inputId: vector_work_coverage})")
    end
  end

  describe '#bbox_display_inputs' do
    subject { helper.bbox_display_inputs }
    it { is_expected.to include('North', 'East', 'South', 'West') }
  end

  describe '#base_input_id' do
    it 'returns the id of the bounding box input element' do
      expect(helper.bbox_input_id(property)).to eq('vector_work_coverage')
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

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