blob: daee718d56b635f3d19da347274408c298c24aa3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
require 'spec_helper'
describe Referential do
it { should validate_presence_of(:name) }
it { should validate_presence_of(:slug) }
it { should validate_presence_of(:prefix) }
it { should validate_presence_of(:time_zone) }
end
describe Chouette::StopArea do
# check override methods
subject {Factory(:stop_area)}
it "should return referential projection " do
subject.referential.projection_type='27572'
subject.projection.should == subject.referential.projection_type
end
it "should return projection coordinates when referential has projection" do
subject.latitude = 45
subject.longitude = 0
subject.referential.projection_type='27572'
subject.projection_x.should_not be_nil
subject.projection_y.should_not be_nil
end
it "should return nil projection coordinates when referential has no projection" do
subject.latitude = 45
subject.longitude = 0
subject.referential.projection_type=nil
subject.projection_x.should be_nil
subject.projection_y.should be_nil
end
end
describe Chouette::AccessPoint do
# check override methods
subject {Factory(:access_point)}
it "should return referential projection " do
subject.referential.projection_type='27572'
subject.projection.should == subject.referential.projection_type
end
it "should return projection coordinates when referential has projection" do
subject.latitude = 45
subject.longitude = 0
subject.referential.projection_type='27572'
subject.projection_x.should_not be_nil
subject.projection_y.should_not be_nil
end
it "should return nil projection coordinates when referential has no projection" do
subject.latitude = 45
subject.longitude = 0
subject.referential.projection_type=nil
subject.projection_x.should be_nil
subject.projection_y.should be_nil
end
end
|