VRFS-905 and also fix failed test

This commit is contained in:
Anthony Davis 2014-04-15 22:09:16 -05:00
parent ca78165cf0
commit addc1e0475
2 changed files with 17 additions and 1 deletions

View File

@ -24,6 +24,14 @@ FactoryGirl.define do
admin true
end
factory :band_musician do
after(:create) do |user|
band = FactoryGirl.create(:band)
user.bands << band
# user.band_musicians << BandMusician.create(:band_id => band.id, :user_id => user.id, :admin => true)
end
end
before(:create) do |user|
user.musician_instruments << FactoryGirl.build(:musician_instrument, user: user)
end

View File

@ -377,6 +377,7 @@ def change_session_genre #randomly just change it
here = 'select.genre-list'
#wait_for_ajax
find('#session-settings-button').trigger(:click)
find('#session-settings-dialog') # ensure the dialog is visible
within('#session-settings-dialog') do
wait_for_ajax
@new_genre = get_options(here).-(["Select Genre"]).-(selected_genres).sample.to_s
@ -417,11 +418,18 @@ end
def view_profile_of user
id = user.kind_of?(JamRuby::User) ? user.id : user
# assume some user signed in already (allows reuse in multi-user tests)
# assume some user signed in already
visit "/client#/profile/#{id}"
wait_until_curtain_gone
end
def view_band_profile_of band
id = band.kind_of?(JamRuby::Band) ? band.id :
band.kind_of?(JamRuby::BandMusician) ? band.bands.first.id : band
visit "/client#/bandProfile/#{id}"
wait_until_curtain_gone
end
def show_user_menu
page.execute_script("$('ul.shortcuts').show()")
#page.execute_script("JK.UserDropdown.menuHoverIn()")