Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. require 'spec_helper'
  2.  
  3. describe "AdminWorkoutEditingSpec", :type => :feature, :js => true do
  4. include FeatureSpecHelper
  5.  
  6. let(:coach) { User.with_roles(:coach, :admin).first!}
  7.  
  8. let(:member){
  9. Participant.find_by_id(100).user
  10. }
  11.  
  12. before do
  13. login_user(coach)
  14. wait_for_ajax
  15. visit('/admin/workouts')
  16. end
  17.  
  18. it "creates a new workout" do
  19. expect(page).to have_content('administration - workouts')
  20. click_on('New Workout', :match=>:first)
  21. expect(page).to have_content('administration - workouts - new workout')
  22. click_on('Add a new template to this workout')
  23. fill_in('workout_template_name', :with => "Test Template")
  24. fill_in('workout_template_description', :with =>Faker::Lorem.paragraph)
  25. within ".live-form" do
  26. click_on('Save')
  27. end
  28. expect(page).to have_content("Test Template")
  29. test_template = WorkoutTemplate.find_by_name("Test Template")
  30. expect(test_template.order).to eq(2)
  31. click_on("Move this template up in the progression", :match=>:first)
  32. wait_for_ajax
  33. expect(test_template.order).to eq(1)
  34. end
  35.  
  36. # it 'edits an existing workout' do
  37. # click_on('Basic Plan Card')
  38. # expect(page).to have_content('administration - workouts -basic plan card')
  39. # end
  40.  
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement