forked from Empact/spatial_adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pulled out some shared specs to reduce duplication
- Loading branch information
Pete Deffendol
committed
Sep 2, 2010
1 parent
d0c3131
commit fadb564
Showing
3 changed files
with
48 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
share_as :CommonModelActions do | ||
describe 'finding records' do | ||
it 'should retrieve Point objects' do | ||
model = PointModel.create(:extra => 'test', :geom => GeometryFactory.point) | ||
PointModel.find(model.id).geom.should == GeometryFactory.point | ||
end | ||
|
||
it 'should retrieve LineString objects' do | ||
model = LineStringModel.create(:extra => 'test', :geom => GeometryFactory.line_string) | ||
LineStringModel.find(model.id).geom.should == GeometryFactory.line_string | ||
end | ||
|
||
it 'should retrieve Polygon objects' do | ||
model = PolygonModel.create(:extra => 'test', :geom => GeometryFactory.polygon) | ||
PolygonModel.find(model.id).geom.should == GeometryFactory.polygon | ||
end | ||
|
||
it 'should retrieve MultiPoint objects' do | ||
model = MultiPointModel.create(:extra => 'test', :geom => GeometryFactory.multi_point) | ||
MultiPointModel.find(model.id).geom.should == GeometryFactory.multi_point | ||
end | ||
|
||
it 'should retrieve MultiLineString objects' do | ||
model = MultiLineStringModel.create(:extra => 'test', :geom => GeometryFactory.multi_line_string) | ||
MultiLineStringModel.find(model.id).geom.should == GeometryFactory.multi_line_string | ||
end | ||
|
||
it 'should retrieve MultiPolygon objects' do | ||
model = MultiPolygonModel.create(:extra => 'test', :geom => GeometryFactory.multi_polygon) | ||
MultiPolygonModel.find(model.id).geom.should == GeometryFactory.multi_polygon | ||
end | ||
|
||
it 'should retrieve GeometryCollection objects' do | ||
model = GeometryCollectionModel.create(:extra => 'test', :geom => GeometryFactory.geometry_collection) | ||
GeometryCollectionModel.find(model.id).geom.should == GeometryFactory.geometry_collection | ||
end | ||
|
||
it 'should retrieve Geometry objects' do | ||
model = GeometryModel.create(:extra => 'test', :geom => GeometryFactory.point) | ||
GeometryModel.find(model.id).geom.should == GeometryFactory.point | ||
end | ||
end | ||
end |