ftue fixes VRFS-4171, VRFS-4172

This commit is contained in:
Seth Call 2016-05-31 11:13:49 -05:00
parent e8843bfd64
commit 8793c77033
8 changed files with 29 additions and 15 deletions

View File

@ -1,3 +1,4 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

View File

@ -81,6 +81,7 @@ module JamRuby
candidate = scheduled_time(i + week_offset)
#puts "#{i}: candidate #{candidate} week_offset:#{week_offset}"
#puts "DAY_OF_WEEK #{day_of_week}"
if day_of_week && candidate <= minimum_start_time
# move it up a week
week_offset += 1

View File

@ -165,7 +165,7 @@ module JamRuby
end
# test drives don't have a lesson_payment_charge, so we don't join against them
MusicSession.joins(lesson_session: [:lesson_booking]).where('lesson_sessions.status = ?', LessonSession::STATUS_COMPLETED).where('lesson_sessions.lesson_type = ?', LESSON_TYPE_TEST_DRIVE).where("session_removed_at IS NOT NULL OR ? > scheduled_start + (INTERVAL '1 minutes' * duration)", Time.now).where('analysed = true').where('lesson_sessions.post_processed = false').each do |music_session|
MusicSession.joins(lesson_session: [:lesson_booking]).where('lesson_sessions.status = ?', LessonSession::STATUS_COMPLETED).where('lesson_sessions.lesson_type = ?', LESSON_TYPE_TEST_DRIVE).where("? > scheduled_start + (INTERVAL '1 minutes' * duration)", Time.now).where('analysed = true').where('lesson_sessions.post_processed = false').each do |music_session|
lession_session = music_session.lesson_session
lession_session.session_completed
end
@ -366,7 +366,9 @@ module JamRuby
end
def recurring_completed
puts "RECURRING COMPLETED #{success}"
if success
if lesson_booking.is_monthly_payment?
# monthly payments are handled at beginning of month; just poke with email, and move on
@ -399,6 +401,7 @@ module JamRuby
end
else
puts "STUDENT NO BILL SENT #{self.id}"
if !sent_notices
if !school_on_school?
# bad session; just poke user
@ -422,6 +425,7 @@ module JamRuby
else
if !sent_notices
if !school_on_school?
puts "STUDENT NO BILL SENT #{success}"
UserMailer.student_lesson_normal_no_bill(self).deliver
UserMailer.teacher_lesson_normal_no_bill(self).deliver
end

View File

@ -55,7 +55,7 @@ describe "Recurring Lesson Flow" do
booking.status.should eql LessonBooking::STATUS_REQUESTED
######### Teacher counters with new slot
teacher_countered_slot = FactoryGirl.build(:lesson_booking_slot_single, hour: 14, update_all: true)
teacher_countered_slot = FactoryGirl.build(:lesson_booking_slot_recurring, hour: 14, update_all: true)
UserMailer.deliveries.clear
lesson_session.counter({proposer: teacher_user, slot: teacher_countered_slot, message: 'Does this work?'})
booking.reload
@ -81,7 +81,7 @@ describe "Recurring Lesson Flow" do
#notification.message.should eql "Instructor has proposed a different time for your lesson."
######### Student counters with new slot
student_countered_slot = FactoryGirl.build(:lesson_booking_slot_single, hour: 16, update_all: true)
student_countered_slot = FactoryGirl.build(:lesson_booking_slot_recurring, hour: 16, update_all: true)
UserMailer.deliveries.clear
lesson_session.counter({proposer: user, slot: student_countered_slot, message: 'Does this work better?'})
lesson_session.errors.any?.should be false
@ -105,7 +105,7 @@ describe "Recurring Lesson Flow" do
######## Teacher accepts slot
UserMailer.deliveries.clear
lesson_session.accept({message: 'Yeah I got this', slot: student_counter.id, update_all: false, accepter: teacher_user})
lesson_session.accept({message: 'Yeah I got this', slot: student_counter.id, accepter: teacher_user})
UserMailer.deliveries.each do |del|
# puts del.inspect
end
@ -135,6 +135,9 @@ describe "Recurring Lesson Flow" do
user.reload
user.sales.length.should eql 0
booking.reload
booking.lesson_sessions[0].scheduled_start.should_not eql booking.lesson_sessions[1].scheduled_start
# teacher & student get into session
start = lesson_session.scheduled_start
end_time = lesson_session.scheduled_start + (60 * lesson_session.duration)

View File

@ -1105,6 +1105,11 @@
return false;
}
if (!passedOnce) {
passedOnce = true;
autoAssignToSingleInput();
}
if(!savedProfile) {
context.jamClient.FTUESetMusicProfileName(gearUtils.createProfileName(selectedDeviceInfo));
var result = context.jamClient.FTUESave(true);
@ -1122,10 +1127,6 @@
}
}
if (!passedOnce) {
passedOnce = true;
autoAssignToSingleInput();
}
// keep the shared state between step 2 and step 3 up-to-date
wizard.setChosenInputs(context._.map($assignedInputs, function(input) { return $(input).attr('data-id') }));
@ -1182,6 +1183,7 @@
}
function newSession() {
passedOnce = false;
savedProfile = false;
initialScan = false;
deviceInformation = gearUtils.loadDeviceInfo();

View File

@ -16,14 +16,13 @@
.wizard-step{ 'layout-wizard-step' => "1", 'dialog-title' => "Select & Test Audio Gear", 'dialog-purpose' => "SelectAudioGear" }
.ftuesteps
.clearall
.help-text In this step, you will select, configure, and test your audio gear. Please watch the video for best instructions.
.help-text In this step, you will select, configure, and test your audio gear. Please click Instructions button for guidance.
.wizard-step-content
.wizard-step-column
%h2 Instructions
.ftue-box.instructions
%ul
%li Select audio interface for inputs and outputs.
%li Check input ports to which you will connect instruments or mics.
%li Check output ports you will use to monitor.
%li Configure interface settings.
%li View test results.

View File

@ -1,7 +1,11 @@
require 'factory_girl'
require 'timecop'
require 'rspec-rails'
begin
require Rails.root.join('spec', 'support', 'lessons.rb')
rescue LoadError
puts "for production; we ignore LoadError"
end
namespace :lessons do
@ -77,8 +81,8 @@ namespace :lessons do
end
task book_test_drive: :environment do |task, args|
user = User.find_by_email(ENV['STUDENT_EMAIL'])
teacher = User.find_by_email(ENV['TEACHER_EMAIL'])
user = User.find_by_email(ENV['STUDENT'])
teacher = User.find_by_email(ENV['TEACHER'])
slots = []
@ -91,7 +95,6 @@ namespace :lessons do
user.save!
end
booking = LessonBooking.book_test_drive(user, teacher, slots, "Hey I've heard of you before.")
if booking.errors.any?
puts booking.errors.inspect
@ -100,7 +103,7 @@ namespace :lessons do
lesson = booking.lesson_sessions[0]
if user.most_recent_test_drive_purchase.nil?
LessonPackagePurchase.create(user, lesson.booking, LessonPackageType.test_drive_4)
LessonPackagePurchase.create(user, lesson.lesson_booking, LessonPackageType.test_drive_4)
end
#lesson.accept({message: 'Yeah I got this', slot: slots[0]})
@ -109,6 +112,6 @@ namespace :lessons do
#lesson.slot.should eql slots[0]
#lesson.status.should eql LessonSession::STATUS_APPROVED
puts "http://localhost:3000/client#/jamclass/lesson-booking/#{lesson.booking.id}"
puts "http://localhost:3000/client#/jamclass/lesson-booking/#{lesson.lesson_booking.id}"
end
end

View File

@ -25,6 +25,7 @@ def teacher_approve(lesson_session)
sign_out_poltergeist(validate: true)
sign_in_poltergeist(lesson_session.teacher, password: 'foobar')
visit "/client#/jamclass/lesson-booking/" + lesson_session.id
find(".slot-decision-field[data-slot-id=\"#{lesson_session.lesson_booking.default_slot.id}\"] ins", visible: false).trigger(:click)
find('.schedule.button-orange').trigger(:click)
# dismiss banner
#find('a.button-orange', text:'CLOSE').trigger(:click)