Sha256: 6f4cde5e40d8dc9bf328f894b45ffff65f0c357f0e4f5d98915fdc9a7e8745a6

Contents?: true

Size: 837 Bytes

Versions: 3

Compression:

Stored size: 837 Bytes

Contents

require 'spec_helper'

describe GeoConcerns::BoundingBoxHelper do
  let(:property) { :coverage }
  let(:helper) { TestingHelper.new }
  before do
    class TestingHelper
      include GeoConcerns::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 '#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

3 entries across 3 versions & 1 rubygems

Version Path
geo_concerns-0.0.6 spec/helpers/bounding_box_helper_spec.rb
geo_concerns-0.0.5 spec/helpers/bounding_box_helper_spec.rb
geo_concerns-0.0.4 spec/helpers/bounding_box_helper_spec.rb