Sha256: 6581be7d80b651cb61d4121fed4e4fac234429fcbcf03a6568072cbabc2acf32
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
require 'spec_helper' describe ActiveRoad::LogicalRoad do subject { create(:logical_road) } it "should have a name" do subject.should respond_to(:name) end describe "at" do context "when the given number exists" do #let(:physical_road) { create :physical_road, :logical_road => subject } #let(:number) { create :street_number, :physical_road => physical_road } it "should return the number geometry" do #subject.at(number.number).should == number.geometry subject.name.should_not be_nil end end context "when the given number is between two existing numbers" do # let(:physical_road) { create :physical_road, :logical_road => subject } # let(:number) { 45 } # let!(:previous_number) do # physical_road.numbers.create create.attributes_for(:street_number, :location_on_road => 0.5, :number => "30") # end # let!(:next_number) do # physical_road.numbers.create create.attributes_for(:street_number, :location_on_road => 1, :number => "60") # end # let(:estimated_geometry) { subject.geometry.interpolate_point(0.75) } # it "should return the estimated geometry" do # subject.at(number).should == estimated_geometry # end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
active_road-0.0.2 | spec/models/active_road/logical_road_spec.rb |