diff options
| author | Luc Donnet | 2015-01-05 14:56:12 +0100 |
|---|---|---|
| committer | Luc Donnet | 2015-01-05 14:56:12 +0100 |
| commit | 3bc6d313bebdc1f03e4021aabbc774a0cd97d938 (patch) | |
| tree | ac5b8c6d8309012136606d9fd9b9a00290f486a8 /spec/features/time_tables_spec.rb | |
| parent | e632a4634b1762f4c73d11f1e5b127de9832a1ff (diff) | |
| download | chouette-core-3bc6d313bebdc1f03e4021aabbc774a0cd97d938.tar.bz2 | |
Initialize rails 4 migration
Diffstat (limited to 'spec/features/time_tables_spec.rb')
| -rw-r--r-- | spec/features/time_tables_spec.rb | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/spec/features/time_tables_spec.rb b/spec/features/time_tables_spec.rb new file mode 100644 index 000000000..d9304c5ba --- /dev/null +++ b/spec/features/time_tables_spec.rb @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +require 'spec_helper' + +describe "TimeTables", :type => :feature do + login_user + + let!(:time_tables) { Array.new(2) { create(:time_table) } } + subject { time_tables.first } + + describe "list" do + it "display time_tables" do + visit referential_time_tables_path(referential) + expect(page).to have_content(time_tables.first.comment) + expect(page).to 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}" + expect(page).to 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 "Nom", :with => "TimeTable 1" + fill_in "Identifiant Neptune", :with => "test:Timetable:1" + click_button("Créer Calendrier") + expect(page).to 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 "Nom", :with => "TimeTable Modified" + click_button("Modifier Calendrier") + expect(page).to have_content("TimeTable Modified") + end + end + +end |
