allpro/spec/features/workouts_spec.rb

39 lines
885 B
Ruby
Raw Normal View History

2013-08-04 20:58:01 -04:00
require 'spec_helper'
describe "Workouts" do
before :all do
@workout = FactoryGirl.create(:workout)
end
describe "GET /workouts" do
it "should return workouts" do
visit workouts_path
page.should have_content @workout.date
end
end
2013-08-04 21:51:46 -04:00
describe "GET /workouts/(:id)" do
2013-08-04 23:40:58 -04:00
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
2013-08-04 21:51:46 -04:00
it "should return the correct workout" do
visit "#{workouts_path}/#{@workout.id}"
page.should have_content @workout.date
end
end
2013-08-05 01:07:11 -04:00
describe "PUT /workouts/(:id)" do
it "should edit the workout" do
visit workouts_path
find("#workout_#{@workout.id}").click_link 'Edit'
2013-08-10 02:11:11 -04:00
2013-08-05 01:07:11 -04:00
current_path.should == edit_workout_path(@workout)
end
end
2013-08-04 20:58:01 -04:00
end