
require 'spec_helper'

describe "RSVP Dialogs", :js => true, :type => :feature, :capybara_feature => true do
=begin
end
  subject { page }

  let (:user) {FactoryGirl.create(:user)}
  let (:rsvp_requester) {FactoryGirl.create(:user)}
  let (:session) {FactoryGirl.create(:music_session, :creator => user, :scheduled_start => Time.now + 2.hours)}
  let (:unstructured_rsvp_session) {FactoryGirl.create(:music_session, :creator => user, :is_unstructured_rsvp => true)}

  def create_slots(slots = [])
  end

  def create_rsvp_requests(requests = [])
  end

  # set up users, session, RSVP request data
  before(:each) do
    RsvpRequestRsvpSlot.delete_all
    RsvpRequest.delete_all
    RsvpSlot.delete_all

    fast_signin(user, Nav.find_session)
  end

  describe "RSVP submission" do

    it "should show session info" do

    end

    it "should show only open slots for structured RSVP session" do

    end

    it "should show a single Play Any Instrument You Like slot for unstructured RSVP session" do

    end

    it "should allow a comment to be entered" do

    end

    it "should have Help, Cancel, and Submit RSVP buttons" do

    end

  end

  describe "RSVP cancellation" do

    it "should show session info" do

    end

    it "should have 2 cancellation options" do

    end

    it "should have Help, Cancel, and Cancel RSVP buttons" do

    end

    it "should show Recurs once... text for recurring session" do

    end

    it "should suppress Recurs once... text for non-recurring session" do

    end
    
    it "should allow cancellation of just this session" do
    
    end

    it "should allow cancellation of all future sessions" do

    end

    it "should allow a comment to be entered" do

    end
  end

  describe "RSVP slot creation" do

    it "should prompt user when no open slots remain for structured RSVP session" do
      # create 2 slots - acoustic guitar and drums

      # create 2 RSVP to acoustic guitar, create 2 RSVP to drums

      # navigate to Session Details screen and approve 1 RSVP for each slot

      # confirm music_session.open_slots.count == 0

      # attempt to approve
    
    end

    it "should prompt user when no open slots remain for relevant instrument for structured RSVP session" do

      # create 2 slots - acoustic guitar and drums

      # create 2 RSVPs to acoustic guitar, create 1 RSVP to drums

      # confirm music_session.open_slots.count == 2

      # navigate to Session Details screen and approve first RSVP

      # confirm music_session.open_slots.count == 1

      # attempt to approve second RSVP - confirm dialog pops up

      # click No - confirm dialog closes

      # attempt to approve drums - confirm RSVP is approved without dialog

      # attempt to approve acoustic guitar again - confirm dialog pops

      # click Yes - confirm new slot is created for acoustic guitar, RSVP is tied to new slot and approved, and dialog closes

      # confirm music_session.open_slots.count == 0

    end

    it "should not prompt user to create slot for unstructured RSVP session" do
      # submit 2 RSVP requests

      # navigate to Session Details screen and approve both RSVPs, confirming the slot dialog does not pop up for either
    end
  end
=end
end
