From 89cfba504c0a15c11003dc7e0edf8acf0517e9de Mon Sep 17 00:00:00 2001 From: Andrew Tomaka Date: Sun, 4 Aug 2013 23:40:58 -0400 Subject: [PATCH] Finish testing show function --- app/views/workouts/index.html.erb | 2 +- spec/factories/workouts.rb | 2 +- spec/features/workouts_spec.rb | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/views/workouts/index.html.erb b/app/views/workouts/index.html.erb index e7d8549..5ec41c6 100644 --- a/app/views/workouts/index.html.erb +++ b/app/views/workouts/index.html.erb @@ -1,5 +1,5 @@ diff --git a/spec/factories/workouts.rb b/spec/factories/workouts.rb index 25c7c34..654d45d 100644 --- a/spec/factories/workouts.rb +++ b/spec/factories/workouts.rb @@ -2,6 +2,6 @@ FactoryGirl.define do factory :workout do - date "2013-08-04 20:31:21" + date Time.now end end diff --git a/spec/features/workouts_spec.rb b/spec/features/workouts_spec.rb index 04321c9..f249aee 100644 --- a/spec/features/workouts_spec.rb +++ b/spec/features/workouts_spec.rb @@ -18,6 +18,14 @@ describe "Workouts" do end describe "GET /workouts/(:id)" do + it "should visit a workout" do + visit workouts_path + click_link @workout.date + + current_path.should == workout_path(@workout.id) + page.should have_content @workout.date + end + it "should return 200" do visit "#{workouts_path}/#{@workout.id}" page.status_code.should be 200