require 'spec_helper'

describe "TeacherProfile", :js => true, :type => :feature, :capybara_feature => true do

  subject { page }

  let(:user) { FactoryGirl.create(:user, traditional_band: true,paid_sessions: true, paid_sessions_hourly_rate: 1,  paid_sessions_daily_rate:1 ) }
  let(:teacher_user) {FactoryGirl.create(:teacher_user, ready_for_session_at: Time.now, first_name: "TeacherUser1")}
  let(:teacher_user2) {FactoryGirl.create(:teacher_user, ready_for_session_at: Time.now, first_name: "TeacherUser2")}

  it "offers test drive bubble" do

    teacher_user.touch
    fast_signin(user, "/client#/profile/teacher/#{teacher_user.id}")

    find('h2', text: 'Book TestDrive Lesson')

  end

  it "shows book normal if you have had a test drive" do
    lesson = testdrive_lesson(user, teacher_user, {finish: true, accept: true})
    fast_signin(user, "/client#/profile/teacher/#{teacher_user.id}")

    find('h2', text: 'Book Lesson')
  end
end
