Finish testing show function
This commit is contained in:
parent
53d689cd91
commit
89cfba504c
3 changed files with 10 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
<ul>
|
||||
<% @workouts.each do |workout| %>
|
||||
<li><%= workout.date %></li>
|
||||
<li><%= link_to workout.date, workout %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
FactoryGirl.define do
|
||||
factory :workout do
|
||||
date "2013-08-04 20:31:21"
|
||||
date Time.now
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue