Skip to content

Commit

Permalink
Add spec to demonstrate mongoid#46
Browse files Browse the repository at this point in the history
This spec shows the reasons why the reported exception in mongoid#46 gets thrown.
  • Loading branch information
cschell committed Jul 13, 2017
1 parent 9d25a5a commit b76a009
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/mongoid/geospatial/fields/polygon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@
expect(geom.radius_sphere(10)[1]).to be_within(0.001).of(0.001569)
end

it 'should handle BSON::Documents containing GeoJSON data' do
coordinates = [[[1, 1], [1, 2], [1, 1]]]

document = BSON::Document.new(type: 'Polygon', coordinates: coordinates)

geom = Mongoid::Geospatial::Polygon.new(document)

expect([*geom]).to eq(corrdinates)
end

describe 'with rgeo' do
# farm.area.should be_a RGeo::Geographic::SphericalPolygonImpl
end
Expand Down

0 comments on commit b76a009

Please sign in to comment.