1
0
Fork 0

Finish testing show function

This commit is contained in:
Andrew Tomaka 2013-08-04 23:40:58 -04:00
parent 53d689cd91
commit 89cfba504c
3 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,5 @@
<ul>
<% @workouts.each do |workout| %>
<li><%= workout.date %></li>
<li><%= link_to workout.date, workout %></li>
<% end %>
</ul>

View File

@ -2,6 +2,6 @@
FactoryGirl.define do
factory :workout do
date "2013-08-04 20:31:21"
date Time.now
end
end

View File

@ -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