VRFS-829 + adding "in session" tests. will watch Jenkins...
This commit is contained in:
parent
826f89d4f3
commit
64509f8592
|
|
@ -14,7 +14,7 @@
|
|||
<%= image_tag "content/icon_resync.png", {:align => "texttop", :height => 14, :width => 12} %>
|
||||
RESYNC
|
||||
</a>
|
||||
<a class="button-grey left" layout-link="session-settings">
|
||||
<a class="button-grey left" layout-link="session-settings" id="session-settings-button">
|
||||
<%= image_tag "content/icon_settings_sm.png", {:align => "texttop", :height => 12, :width => 12} %>
|
||||
SETTINGS
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe "In a Session", :js => true, :type => :feature, :capybara_feature => true do
|
||||
|
||||
subject { page }
|
||||
|
||||
before(:all) do
|
||||
Capybara.javascript_driver = :poltergeist
|
||||
Capybara.current_driver = Capybara.javascript_driver
|
||||
Capybara.default_wait_time = 30 # these tests are SLOOOOOW
|
||||
end
|
||||
|
||||
let(:user) { FactoryGirl.create(:user) }
|
||||
let(:finder) { FactoryGirl.create(:user) }
|
||||
|
||||
before(:each) do
|
||||
UserMailer.deliveries.clear
|
||||
end
|
||||
|
||||
it "isn't possible to see a private session until it is made public", :slow => true do
|
||||
MusicSession.delete_all
|
||||
|
||||
create_session(user, description = "Public or private, I cant decide!")
|
||||
set_session_as_private(user)
|
||||
in_client(finder) do
|
||||
sign_in_poltergeist finder
|
||||
visit "/client#/findSession"
|
||||
# verify private session is not found
|
||||
expect(page).to have_selector('#sessions-none-found')
|
||||
end
|
||||
|
||||
set_session_as_public(user)
|
||||
join_session(finder, description) # verify the public session is able to be joined
|
||||
|
||||
end
|
||||
end
|
||||
|
|
@ -27,13 +27,13 @@ describe "Music Session", :js => true, :type => :feature, :capybara_feature => t
|
|||
context "last person" do
|
||||
before(:each) do
|
||||
UserMailer.deliveries.clear
|
||||
pending
|
||||
#pending
|
||||
@user1, session_description = create_session
|
||||
end
|
||||
|
||||
describe "cleanly leaves music session" do
|
||||
pending
|
||||
describe "cleanly leaves music session" do
|
||||
it "should update music session user session history" do
|
||||
pending
|
||||
should have_link('session-leave')
|
||||
click_link('session-leave')
|
||||
leave_music_session_sleep_delay
|
||||
|
|
@ -46,7 +46,7 @@ describe "Music Session", :js => true, :type => :feature, :capybara_feature => t
|
|||
|
||||
describe "abruptly leaves music session" do
|
||||
it "should delete connection and update music session user session history" do
|
||||
pending
|
||||
#pending
|
||||
should have_link('session-leave')
|
||||
page.evaluate_script("JK.JamServer.close(true)")
|
||||
leave_music_session_sleep_delay
|
||||
|
|
|
|||
|
|
@ -2,13 +2,13 @@ if defined?(TEST_CONNECT_STATES) && TEST_CONNECT_STATES
|
|||
class ActiveRecord::Base
|
||||
mattr_accessor :shared_connection
|
||||
@@shared_connection = nil
|
||||
|
||||
|
||||
def self.connection
|
||||
@@shared_connection || retrieve_connection
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Forces all threads to share the same connection. This works on
|
||||
# Capybara because it starts the web server in a thread.
|
||||
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
|
||||
end
|
||||
end
|
||||
|
|
@ -136,4 +136,25 @@ def create_join_session(creator, joiners=[])
|
|||
joiners.each do |joiner|
|
||||
join_session(joiner, unique_session_desc)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def set_session_as_private(session_owner)
|
||||
in_client(session_owner) do
|
||||
find('#session-settings-button').trigger(:click)
|
||||
within('#session-settings-dialog') do
|
||||
select('Private', :from => 'session-settings-musician-access')
|
||||
find('#session-settings-dialog-submit').trigger(:click)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def set_session_as_public(session_owner)
|
||||
in_client(session_owner) do
|
||||
find('#session-settings-button').trigger(:click)
|
||||
within('#session-settings-dialog') do
|
||||
select('Public', :from => 'session-settings-musician-access')
|
||||
find('#session-settings-dialog-submit').trigger(:click)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue