gares 2.0.0.pre.dev3 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,79 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'spec_helper'
4
-
5
- # This test uses "Lyon Part-Dieu" as a testing sample:
6
- #
7
- # http://www.gares-en-mouvement.com/fr/frlpd/votre-gare/
8
- #
9
- describe Gares::Station do
10
-
11
- describe 'valid gare' do
12
-
13
- before(:each) do
14
- # Get gare de Lyon Part-Dieu
15
- @gare = Gares::Station.search_by_sncf_id('frlpd').first
16
- end
17
-
18
- it 'should find the name' do
19
- name = @gare.name
20
-
21
- expect(name).to eql('Lyon Part-Dieu')
22
- end
23
-
24
- it 'should find the geolocation coordinates' do
25
- lat = @gare.latitude
26
- long = @gare.longitude
27
-
28
- expect(lat).to eql(45.760568)
29
- expect(long).to eql(4.859991)
30
- end
31
-
32
- it 'should have opening hours' do
33
- horaires = @gare.horaires
34
-
35
- expect(horaires.first).to eql('du lundi au dimanche de 04:50 à 00:45')
36
- end
37
-
38
- it 'should have a list of services' do
39
- services = @gare.services
40
-
41
- expect(services).to be_an(Array)
42
- expect(services.first).to_not be_blank
43
- end
44
-
45
- it 'should have a list of sales services' do
46
- sales = @gare.sales
47
-
48
- expect(sales).to be_an(Array)
49
- expect(sales.first).to_not be_blank
50
- end
51
-
52
- context 'Station of Agde' do
53
- before(:each) do
54
- # Get gare de Agde
55
- @gare = Gares::Station.search_by_sncf_id('frxag').first
56
- end
57
-
58
- describe 'a gare without wifi nor defibrillator' do
59
- it { expect(@gare.wifi?).to be(false) }
60
- it { expect(@gare.defibrillator?).to be(false) }
61
- end
62
-
63
- describe 'a gare with no sales services' do
64
- it { expect(@gare.has_borne?).to be(false) }
65
- end
66
- end
67
- end
68
-
69
- describe 'with name that has utf-8 characters' do
70
- # Belleville sur Sâone
71
- before(:each) do
72
- @gare = Gares::Station.search('Saone').first
73
- end
74
-
75
- it 'should give the proper name' do
76
- expect(@gare.name).to eql('Port-sur-Saône')
77
- end
78
- end
79
- end
@@ -1,11 +0,0 @@
1
- describe Gares::Sales do
2
-
3
- context 'with a valid station' do
4
-
5
- subject(:sales) { Gares::Sales.new(sncf_id: 'frqxb') }
6
-
7
- it { expect(sales.has_borne?).to be(true) }
8
-
9
- end
10
-
11
- end