diff options
| author | Bruno Perles | 2015-10-28 11:35:08 +0100 |
|---|---|---|
| committer | Bruno Perles | 2015-10-28 11:35:08 +0100 |
| commit | 5b4136b2907ffc918210495d8f9a29c1e7d681fb (patch) | |
| tree | 6b73ff915c90d450572f5eb9599d3bc0d8938678 /spec/features/timebands_spec.rb | |
| parent | 843bec92850de6f4b46498611842f894a78e7d3d (diff) | |
| download | chouette-core-5b4136b2907ffc918210495d8f9a29c1e7d681fb.tar.bz2 | |
Merge Timeband feature and revert Gemfile
Diffstat (limited to 'spec/features/timebands_spec.rb')
| -rw-r--r-- | spec/features/timebands_spec.rb | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/spec/features/timebands_spec.rb b/spec/features/timebands_spec.rb new file mode 100644 index 000000000..6f07fab4f --- /dev/null +++ b/spec/features/timebands_spec.rb @@ -0,0 +1,62 @@ +# -*- coding: utf-8 -*- +require 'spec_helper' + +describe "Timebands", :type => :feature do + login_user + + let!(:timebands) { Array.new(2) { create(:timeband) } } + subject { timebands.first } + + describe "list" do + it "display timebands" do + visit referential_timebands_path(referential) + expect(page).to have_content(timebands.first.name) + expect(page).to have_content(timebands.last.name) + end + + end + + describe "show" do + it "display timeband" do + visit referential_timebands_path(referential) + click_link "#{timebands.first.name}" + expect(page).to have_content(timebands.first.name) + end + + end + + describe "new" do + it "creates timeband and return to show" do + visit referential_timebands_path(referential) + click_link "Ajouter une plage horaire" + fill_in "Titre", :with => "Timeband 1" + + select '10', from: 'timeband_start_time_4i' + select '00', from: 'timeband_start_time_5i' + select '11', from: 'timeband_end_time_4i' + select '00', from: 'timeband_end_time_5i' + + click_button("Créer plage horaire") + expect(page).to have_content("Timeband 1") + end + end + + describe "edit and return to show" do + it "edit timeband" do + visit referential_timeband_path(referential, subject) + click_link "Modifier cette plage horaire" + fill_in "Titre", :with => "Timeband Modified" + click_button("Modifier plage horaire") + expect(page).to have_content("Timeband Modified") + end + end + + describe "delete and return to list" do + it "delete timeband" do + visit referential_timebands_path(referential) + page.all('.remove')[0].click + expect(page).to_not have_content("Timeband Modified") + end + end + +end |
