Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- describe "AdminWorkoutEditingSpec", :type => :feature, :js => true do
- include FeatureSpecHelper
- let(:coach) { User.with_roles(:coach, :admin).first!}
- let(:member){
- Participant.find_by_id(100).user
- }
- before do
- login_user(coach)
- wait_for_ajax
- visit('/admin/workouts')
- end
- it "creates a new workout" do
- expect(page).to have_content('administration - workouts')
- click_on('New Workout', :match=>:first)
- expect(page).to have_content('administration - workouts - new workout')
- click_on('Add a new template to this workout')
- fill_in('workout_template_name', :with => "Test Template")
- fill_in('workout_template_description', :with =>Faker::Lorem.paragraph)
- within ".live-form" do
- click_on('Save')
- end
- expect(page).to have_content("Test Template")
- test_template = WorkoutTemplate.find_by_name("Test Template")
- expect(test_template.order).to eq(2)
- click_on("Move this template up in the progression", :match=>:first)
- wait_for_ajax
- expect(test_template.order).to eq(1)
- end
- # it 'edits an existing workout' do
- # click_on('Basic Plan Card')
- # expect(page).to have_content('administration - workouts -basic plan card')
- # end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement