blob: 5dbf5220b99eb9076d6f3fff29cc543ae486cdd2 (
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
 | # -*- coding: utf-8 -*-
require 'spec_helper'
describe "TimeTables" do
  login_user
  let!(:referential) { create(:referential).switch }
  let!(:time_tables) { referential; Array.new(2) { create(:time_table) } }
  subject { time_tables.first }
  describe "list" do
    it "display time_tables" do
      visit referential_time_tables_path(referential)
      page.should have_content(time_tables.first.comment)
      page.should have_content(time_tables.last.comment)
    end
    
  end 
  describe "show" do      
    it "display time_table" do
      visit referential_time_tables_path(referential)
      click_link "#{time_tables.first.comment}"
      page.should have_content(time_tables.first.comment)
    end
    
  end
  describe "new" do      
    it "creates time_table and return to show" do
      visit referential_time_tables_path(referential)
      click_link "Ajouter un calendrier"
      fill_in "Description", :with => "TimeTable 1"
      fill_in "Identifiant Neptune", :with => "test:Timetable:1"        
      click_button("Créer calendrier")
      page.should have_content("TimeTable 1")
    end
  end
  describe "edit and return to show" do      
    it "edit time_table" do
      visit referential_time_table_path(referential, subject)
      click_link "Modifier ce calendrier"
      fill_in "Description", :with => "TimeTable Modified"
      click_button("Modifier calendrier")
      page.should have_content("TimeTable Modified")
    end
  end
end
 |