blob: 5d4e3afb37c447677b0ce6de5ab53c96129cd94f (
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
  | 
# -*- coding: utf-8 -*-
require 'spec_helper'
describe "StopAreas" do
  login_user
  let(:stop_areas) { Array.new(2) { Factory(:stop_area) } }
  subject { stop_areas.first }
  describe "list" do
    it "display stop_areas" do
      pending
      visit referential_stop_areas_path(referential)
      page.should have_content(stop_areas.first.name)
      page.should have_content(stop_areas.last.name)
    end
    
  end
  
  describe "show" do      
    it "display stop_area" do
      pending
      visit referential_stop_areas_path(referential)
      click_link "#{stop_areas.first.name}"
      page.should have_content(stop_areas.first.name)
    end
    it "display map" do
      pending
      visit referential_stop_areas_path(referential)
      click_link "#{stop_areas.first.name}"
      page.should have_selector("#map", :class => 'stop_area')
    end
    
  end
  describe "new" do      
    it "creates stop_area and return to show" do
      pending
      visit referential_stop_areas_path(referential)
      click_link "Ajouter un arrêt"
      fill_in "Nom", :with => "StopArea 1"
      fill_in "Numéro d'enregistrement", :with => "test-1"
      #fill_in "Identifiant Neptune", :with => "test:StopArea:1"        
      click_button("Créer arrêt")
      page.should have_content("StopArea 1")
    end
  end
  describe "edit and return to show" do      
    it "edit stop_area" do
      pending
      visit referential_stop_area_path(referential, subject)
      click_link "Modifier cet arrêt"
      fill_in "Nom", :with => "StopArea Modified"
      fill_in "Numéro d'enregistrement", :with => "test-1"
      click_button("Modifier arrêt")
      page.should have_content("StopArea Modified")
    end
  end
end
  |