aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/ninoxe_extension_spec.rb
blob: 016e10496cbef589743a19d3c41b8464a8bfdd44 (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
require 'spec_helper'

describe Chouette::StopArea do
  # check override methods

   subject {create(:stop_area)}

    # FIXME #821
    # it "should return referential projection " do
    #   subject.referential.projection_type='27572'
    #   expect(subject.projection).to eq(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'
    #   expect(subject.projection_x).not_to be_nil
    #   expect(subject.projection_y).not_to 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
    #   expect(subject.projection_x).to be_nil
    #   expect(subject.projection_y).to be_nil
    # end

end

describe Chouette::AccessPoint do
  # check override methods

   subject {create(:access_point)}

    it "should return referential projection" do
      subject.referential.projection_type='27572'
      expect(subject.projection).to eq(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'
      expect(subject.projection_x).not_to be_nil
      expect(subject.projection_y).not_to 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
      expect(subject.projection_x).to be_nil
      expect(subject.projection_y).to be_nil
    end

end