115 lines
3.5 KiB
Ruby
115 lines
3.5 KiB
Ruby
require 'spec_helper'
|
|
|
|
describe "Create Session Flow", :js => true, :type => :feature, :capybara_feature => true do
|
|
context "create session flow" do
|
|
let(:user1) { FactoryGirl.create(:user) }
|
|
let(:user2) { FactoryGirl.create(:user) }
|
|
|
|
before(:each) do
|
|
MusicSession.delete_all
|
|
ActiveMusicSession.delete_all
|
|
|
|
sign_in_poltergeist(user1)
|
|
in_client(user1) do
|
|
visit "/client#/createSession"
|
|
end
|
|
end
|
|
|
|
describe "step 1" do
|
|
it "initial status" do
|
|
in_client(user1) do
|
|
find('.session-step-title', text: 'When Is Your Session?')
|
|
find('#session-when-start-scheduled[checked="checked"]')
|
|
find('div#scheduled-session-not-found')
|
|
find('div[info-id="start-scheduled"]')
|
|
page.should have_css(".session-stepnumber", :count => 2)
|
|
page.should have_css(".session-stepnumber .session-stepactive", :count => 1)
|
|
end
|
|
end
|
|
|
|
it "select option for scheduling a session" do
|
|
in_client(user1) do
|
|
find('li[create-type="schedule-future"] ins').trigger(:click)
|
|
find('div[info-id="scheduled-future"]')
|
|
page.should have_css(".session-stepnumber", :count => 5)
|
|
page.should have_css(".session-stepnumber .session-stepactive", :count => 1)
|
|
find('div#schedule-future-wrapper')
|
|
find('h3', text: 'When will the session happen?')
|
|
find('input#session-start-date')
|
|
find('select#start-time-list')
|
|
find('select#end-time-list')
|
|
find('select#timezone-list')
|
|
find('select#recurring-mode-list')
|
|
end
|
|
end
|
|
|
|
it "select option for scheduling session after others RSVP" do
|
|
in_client(user1) do
|
|
find('li[create-type="rsvp"] ins').trigger(:click)
|
|
find('div[info-id="rsvp"]')
|
|
page.should have_css(".session-stepnumber", :count => 5)
|
|
page.should have_css(".session-stepnumber .session-stepactive", :count => 1)
|
|
end
|
|
end
|
|
|
|
it "select option for starting session right now" do
|
|
in_client(user1) do
|
|
find('li[create-type="immediately"] ins').trigger(:click)
|
|
find('div[info-id="immediately"]')
|
|
page.should have_css(".session-stepnumber", :count => 5)
|
|
page.should have_css(".session-stepnumber .session-stepactive", :count => 1)
|
|
end
|
|
end
|
|
|
|
it "select option for starting quick session" do
|
|
in_client(user1) do
|
|
find('li[create-type="quick-start"] ins').trigger(:click)
|
|
find('div[info-id="quick-start"]')
|
|
page.should have_css(".session-stepnumber", :count => 2)
|
|
page.should have_css(".session-stepnumber .session-stepactive", :count => 1)
|
|
end
|
|
end
|
|
end
|
|
|
|
describe "step 2" do
|
|
before(:each) do
|
|
in_client(user1) do
|
|
find('li[create-type="schedule-future"] ins').trigger(:click)
|
|
find('.btn-next').trigger(:click)
|
|
end
|
|
end
|
|
|
|
it "initial status" do
|
|
in_client(user1) do
|
|
find('.session-step-title', text: 'What Are You Playing?')
|
|
end
|
|
end
|
|
|
|
it "validates genre, name and description" do
|
|
in_client(user1) do
|
|
find('.btn-next').trigger(:click)
|
|
end
|
|
end
|
|
end
|
|
|
|
describe "step 3" do
|
|
before(:each) do
|
|
end
|
|
|
|
it "initial status" do
|
|
end
|
|
|
|
|
|
end
|
|
|
|
describe "step 4" do
|
|
before(:each) do
|
|
end
|
|
end
|
|
|
|
describe "step 5" do
|
|
before(:each) do
|
|
end
|
|
end
|
|
end
|
|
end |