Finish coverage of editing

This commit is contained in:
Andrew Tomaka 2013-08-11 13:35:08 -04:00
parent 62f3b10184
commit 9f260a691c
2 changed files with 12 additions and 0 deletions

View file

@ -2,6 +2,8 @@
# More info at https://github.com/guard/guard#readme # More info at https://github.com/guard/guard#readme
guard :rspec do guard :rspec do
notification :libnotify, :timeout => 5, :transient => true, :append => false, :urgency => :critical
watch(%r{^spec/.+_spec\.rb$}) watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" } watch('spec/spec_helper.rb') { "spec" }

View file

@ -46,6 +46,16 @@ describe "Workouts" do
page.should have_content 'Workout updated' page.should have_content 'Workout updated'
end 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 end
describe "GET /workouts/new" do describe "GET /workouts/new" do