From 9f260a691c4696cae4972c7ca66b8e7377fd73c1 Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 11 Aug 2013 13:35:08 -0400 Subject: [PATCH] Finish coverage of editing --- Guardfile | 2 ++ spec/features/workouts_spec.rb | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/Guardfile b/Guardfile index f855df0..a99de8d 100644 --- a/Guardfile +++ b/Guardfile @@ -2,6 +2,8 @@ # More info at https://github.com/guard/guard#readme guard :rspec do + notification :libnotify, :timeout => 5, :transient => true, :append => false, :urgency => :critical + watch(%r{^spec/.+_spec\.rb$}) watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { "spec" } diff --git a/spec/features/workouts_spec.rb b/spec/features/workouts_spec.rb index 0f3ffc3..6d57294 100644 --- a/spec/features/workouts_spec.rb +++ b/spec/features/workouts_spec.rb @@ -46,6 +46,16 @@ describe "Workouts" do page.should have_content 'Workout updated' end + + it "should not edit with bad data" do + visit workouts_path + find("#workout_#{@workout.id}").click_link 'Edit' + + fill_in 'Date', :with => '2013-13-13' + click_button 'Update Workout' + + page.should have_content "Date is not a valid date" + end end describe "GET /workouts/new" do