2014-01-04 09:10:58 +00:00
|
|
|
require 'faker'
|
|
|
|
|
|
2012-08-06 03:01:00 +00:00
|
|
|
FactoryGirl.define do
|
2012-08-18 18:48:43 +00:00
|
|
|
factory :user, :class => JamRuby::User do
|
2014-08-01 21:17:04 +00:00
|
|
|
ignore do
|
|
|
|
|
specific_instruments nil
|
|
|
|
|
end
|
|
|
|
|
|
2012-08-06 03:01:00 +00:00
|
|
|
sequence(:email) { |n| "person_#{n}@example.com"}
|
2012-11-21 19:48:39 +00:00
|
|
|
sequence(:first_name) { |n| "Person" }
|
|
|
|
|
sequence(:last_name) { |n| "#{n}" }
|
2012-08-06 03:01:00 +00:00
|
|
|
password "foobar"
|
|
|
|
|
password_confirmation "foobar"
|
2012-11-12 12:28:44 +00:00
|
|
|
email_confirmed true
|
2012-11-21 19:48:39 +00:00
|
|
|
city "Apex"
|
|
|
|
|
state "NC"
|
2013-11-03 07:49:51 +00:00
|
|
|
country "US"
|
2012-11-30 15:23:43 +00:00
|
|
|
musician true
|
2013-03-15 04:22:31 +00:00
|
|
|
terms_of_service true
|
2014-06-17 19:10:24 +00:00
|
|
|
last_jam_audio_latency 5
|
2014-02-19 22:56:13 +00:00
|
|
|
|
2013-03-15 04:22:31 +00:00
|
|
|
#u.association :musician_instrument, factory: :musician_instrument, user: u
|
|
|
|
|
|
2014-08-01 21:17:04 +00:00
|
|
|
before(:create) do |user, evaluator|
|
|
|
|
|
if evaluator.specific_instruments
|
|
|
|
|
evaluator.specific_instruments.each do |instrument|
|
|
|
|
|
user.musician_instruments << FactoryGirl.build(:musician_instrument, user: user, instrument: instrument)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
user.musician_instruments << FactoryGirl.build(:musician_instrument, user: user)
|
|
|
|
|
end
|
2013-03-15 04:22:31 +00:00
|
|
|
end
|
2012-08-06 03:01:00 +00:00
|
|
|
|
2014-02-19 22:56:13 +00:00
|
|
|
factory :fan do
|
|
|
|
|
musician false
|
|
|
|
|
end
|
|
|
|
|
|
2012-08-06 03:01:00 +00:00
|
|
|
factory :admin do
|
|
|
|
|
admin true
|
|
|
|
|
end
|
2014-01-25 20:03:14 +00:00
|
|
|
|
2014-09-22 19:20:58 +00:00
|
|
|
factory :austin_user do
|
|
|
|
|
first_name 'Austin'
|
|
|
|
|
sequence(:last_name) { |n| "#{n}" }
|
|
|
|
|
state 'TX'
|
|
|
|
|
city 'Austin'
|
|
|
|
|
last_jam_locidispid { austin_geoip[:locidispid] }
|
|
|
|
|
last_jam_addr { austin_ip }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :dallas_user do
|
|
|
|
|
first_name 'Dallas'
|
|
|
|
|
sequence(:last_name) { |n| "#{n}" }
|
|
|
|
|
state 'TX'
|
|
|
|
|
city 'Dallas'
|
|
|
|
|
last_jam_locidispid { dallas_geoip[:locidispid] }
|
|
|
|
|
last_jam_addr { dallas_ip }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :houston_user do
|
|
|
|
|
first_name 'Houston'
|
|
|
|
|
sequence(:last_name) { |n| "#{n}" }
|
|
|
|
|
state 'TX'
|
|
|
|
|
city 'Houston'
|
|
|
|
|
last_jam_locidispid { houston_geoip[:locidispid] }
|
|
|
|
|
last_jam_addr { houston_ip }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :miami_user do
|
|
|
|
|
first_name 'Miami'
|
|
|
|
|
sequence(:last_name) { |n| "#{n}" }
|
|
|
|
|
state 'FL'
|
|
|
|
|
city 'Miami'
|
|
|
|
|
last_jam_locidispid { miami_geoip[:locidispid] }
|
|
|
|
|
last_jam_addr { miami_ip }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :seattle_user do
|
|
|
|
|
first_name 'Seattle'
|
|
|
|
|
sequence(:last_name) { |n| "#{n}" }
|
|
|
|
|
state 'WA'
|
|
|
|
|
city 'Seattle'
|
|
|
|
|
last_jam_locidispid { seattle_geoip[:locidispid] }
|
|
|
|
|
last_jam_addr { seattle_ip }
|
|
|
|
|
end
|
2014-01-25 20:03:14 +00:00
|
|
|
factory :single_user_session do
|
|
|
|
|
after(:create) do |user, evaluator|
|
2014-05-06 21:17:26 +00:00
|
|
|
active_music_session = FactoryGirl.create(:active_music_session, :creator => user)
|
|
|
|
|
connection = FactoryGirl.create(:connection, :user => user, :music_session => active_music_session)
|
2014-01-25 20:03:14 +00:00
|
|
|
end
|
|
|
|
|
end
|
2012-08-06 03:01:00 +00:00
|
|
|
end
|
2012-08-18 18:48:43 +00:00
|
|
|
|
2014-05-06 21:17:26 +00:00
|
|
|
factory :musician_instrument, :class => JamRuby::MusicianInstrument do
|
|
|
|
|
instrument { JamRuby::Instrument.find('electric guitar') }
|
|
|
|
|
proficiency_level 1
|
|
|
|
|
priority 0
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
factory :active_music_session_no_user_history, :class => JamRuby::ActiveMusicSession do
|
|
|
|
|
|
|
|
|
|
association :creator, factory: :user
|
|
|
|
|
|
2014-05-06 13:34:38 +00:00
|
|
|
ignore do
|
|
|
|
|
name "My Music Session"
|
|
|
|
|
description "Come Music Session"
|
|
|
|
|
fan_chat true
|
|
|
|
|
fan_access true
|
|
|
|
|
approval_required false
|
|
|
|
|
musician_access true
|
|
|
|
|
legal_terms true
|
2014-05-06 21:17:26 +00:00
|
|
|
genre JamRuby::Genre.first
|
|
|
|
|
band nil
|
2014-06-25 21:54:31 +00:00
|
|
|
language 'eng'
|
2014-05-06 13:34:38 +00:00
|
|
|
end
|
2014-01-25 20:03:14 +00:00
|
|
|
|
2014-05-06 21:17:26 +00:00
|
|
|
|
2014-05-06 13:34:38 +00:00
|
|
|
before(:create) do |session, evaluator|
|
2014-07-14 21:43:46 +00:00
|
|
|
if evaluator.music_session
|
|
|
|
|
session.id = evaluator.music_session.id
|
|
|
|
|
else
|
|
|
|
|
music_session = FactoryGirl.create(:music_session, name: evaluator.name, description: evaluator.description, fan_chat: evaluator.fan_chat,
|
|
|
|
|
fan_access: evaluator.fan_access, approval_required: evaluator.approval_required, musician_access: evaluator.musician_access,
|
|
|
|
|
genre: evaluator.genre, creator: evaluator.creator, band: evaluator.band, language: evaluator.language)
|
|
|
|
|
session.id = music_session.id
|
|
|
|
|
end
|
2014-05-06 13:34:38 +00:00
|
|
|
end
|
2014-02-06 21:02:04 +00:00
|
|
|
|
2014-05-06 13:34:38 +00:00
|
|
|
factory :active_music_session do
|
2014-02-06 21:02:04 +00:00
|
|
|
after(:create) { |session|
|
2014-05-06 13:34:38 +00:00
|
|
|
FactoryGirl.create(:music_session_user_history, :history => session.music_session, :user => session.creator)
|
2014-02-06 21:02:04 +00:00
|
|
|
}
|
|
|
|
|
|
2014-05-07 15:53:39 +00:00
|
|
|
factory :active_music_session_with_mount do
|
2014-01-25 20:03:14 +00:00
|
|
|
association :mount, :factory => :icecast_mount
|
2014-02-06 21:02:04 +00:00
|
|
|
end
|
2014-01-25 20:03:14 +00:00
|
|
|
end
|
2013-07-03 01:11:04 +00:00
|
|
|
end
|
|
|
|
|
|
2014-05-06 22:50:41 +00:00
|
|
|
factory :music_session, :class => JamRuby::MusicSession do
|
2014-05-06 21:17:26 +00:00
|
|
|
sequence(:name) { |n| "Music Session #{n}" }
|
|
|
|
|
sequence(:description) { |n| "Music Session Description #{n}" }
|
|
|
|
|
fan_chat true
|
2014-02-20 07:45:51 +00:00
|
|
|
fan_access true
|
2014-05-06 21:17:26 +00:00
|
|
|
approval_required false
|
|
|
|
|
musician_access true
|
|
|
|
|
legal_terms true
|
2014-06-24 03:26:27 +00:00
|
|
|
language 'eng'
|
2014-07-11 22:21:55 +00:00
|
|
|
timezone 'UTC,Etc/UTC'
|
2014-05-06 21:17:26 +00:00
|
|
|
legal_policy 'standard'
|
2014-05-15 17:22:21 +00:00
|
|
|
recurring_mode 'once'
|
2014-05-06 21:17:26 +00:00
|
|
|
genre JamRuby::Genre.first
|
|
|
|
|
association :creator, :factory => :user
|
2014-07-04 13:26:46 +00:00
|
|
|
open_rsvps true
|
2014-06-17 19:10:24 +00:00
|
|
|
scheduled_start Time.now
|
2014-07-11 22:21:55 +00:00
|
|
|
scheduled_duration 3600
|
2014-05-15 17:22:21 +00:00
|
|
|
|
|
|
|
|
factory :recurring_music_session_weekly do
|
|
|
|
|
recurring_mode 'weekly'
|
|
|
|
|
end
|
2014-06-17 19:10:24 +00:00
|
|
|
|
|
|
|
|
after(:create) do |music_session|
|
|
|
|
|
FactoryGirl.create(:chosen_rsvp_slot, user: music_session.creator, music_session: music_session)
|
|
|
|
|
end
|
2013-07-03 01:11:04 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :music_session_user_history, :class => JamRuby::MusicSessionUserHistory do
|
|
|
|
|
ignore do
|
|
|
|
|
history nil
|
|
|
|
|
user nil
|
|
|
|
|
end
|
2013-04-17 00:36:01 +00:00
|
|
|
|
2014-02-20 16:20:20 +00:00
|
|
|
instruments 'guitar'
|
2014-05-06 13:34:38 +00:00
|
|
|
music_session_id { history.id }
|
2013-07-03 01:11:04 +00:00
|
|
|
user_id { user.id }
|
|
|
|
|
sequence(:client_id) { |n| "Connection #{n}" }
|
2012-08-18 18:48:43 +00:00
|
|
|
end
|
|
|
|
|
|
2012-10-21 01:55:49 +00:00
|
|
|
factory :connection, :class => JamRuby::Connection do
|
2012-11-02 06:51:52 +00:00
|
|
|
sequence(:client_id) { |n| "Client#{n}" }
|
2014-02-22 04:21:31 +00:00
|
|
|
ip_address "1.1.1.1"
|
2012-11-30 15:23:43 +00:00
|
|
|
as_musician true
|
2014-02-22 04:21:31 +00:00
|
|
|
addr 0
|
|
|
|
|
locidispid 0
|
2014-03-07 20:20:34 +00:00
|
|
|
client_type 'client'
|
2014-09-24 19:27:56 +00:00
|
|
|
gateway 'gateway1'
|
2014-06-18 01:07:40 +00:00
|
|
|
last_jam_audio_latency { user.last_jam_audio_latency if user }
|
2014-06-23 05:56:44 +00:00
|
|
|
sequence(:channel_id) { |n| "Channel#{n}"}
|
2014-05-16 19:39:37 +00:00
|
|
|
association :user, factory: :user
|
2014-09-13 03:30:51 +00:00
|
|
|
scoring_timeout Time.now
|
2012-08-18 18:48:43 +00:00
|
|
|
end
|
2012-10-26 10:33:39 +00:00
|
|
|
|
|
|
|
|
factory :invitation, :class => JamRuby::Invitation do
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :friendship, :class => JamRuby::Friendship do
|
|
|
|
|
|
|
|
|
|
end
|
2012-11-12 12:28:44 +00:00
|
|
|
|
2014-03-25 15:29:08 +00:00
|
|
|
factory :friend_request, :class => JamRuby::FriendRequest do
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
2012-12-06 01:56:12 +00:00
|
|
|
factory :band_musician, :class => JamRuby::BandMusician do
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
2012-11-12 12:28:44 +00:00
|
|
|
factory :band, :class => JamRuby::Band do
|
2012-11-21 19:48:39 +00:00
|
|
|
sequence(:name) { |n| "Band" }
|
|
|
|
|
biography "My Biography"
|
|
|
|
|
city "Apex"
|
|
|
|
|
state "NC"
|
2013-11-03 07:49:51 +00:00
|
|
|
country "US"
|
2014-02-19 22:56:13 +00:00
|
|
|
before(:create) { |band|
|
|
|
|
|
band.genres << Genre.first
|
|
|
|
|
}
|
2012-11-12 12:28:44 +00:00
|
|
|
end
|
2012-12-05 19:10:58 +00:00
|
|
|
|
|
|
|
|
factory :genre, :class => JamRuby::Genre do
|
|
|
|
|
description { |n| "Genre #{n}" }
|
|
|
|
|
end
|
2012-11-30 15:23:43 +00:00
|
|
|
|
|
|
|
|
factory :join_request, :class => JamRuby::JoinRequest do
|
|
|
|
|
text 'let me in to the session!'
|
|
|
|
|
end
|
2013-01-15 02:13:45 +00:00
|
|
|
|
|
|
|
|
factory :track, :class => JamRuby::Track do
|
|
|
|
|
sound "mono"
|
2013-11-16 04:35:40 +00:00
|
|
|
sequence(:client_track_id) { |n| "client_track_id#{n}"}
|
2013-01-15 02:13:45 +00:00
|
|
|
end
|
|
|
|
|
|
2014-10-03 18:36:51 +00:00
|
|
|
factory :video_source, :class => JamRuby::VideoSource do
|
2014-10-10 16:07:36 +00:00
|
|
|
#client_video_source_id "test_source_id"
|
|
|
|
|
sequence(:client_video_source_id) { |n| "client_video_source_id#{n}"}
|
2014-10-03 18:36:51 +00:00
|
|
|
end
|
|
|
|
|
|
2013-01-30 05:46:40 +00:00
|
|
|
factory :recorded_track, :class => JamRuby::RecordedTrack do
|
2014-02-06 21:02:04 +00:00
|
|
|
instrument JamRuby::Instrument.first
|
|
|
|
|
sound 'stereo'
|
|
|
|
|
sequence(:client_id) { |n| "client_id-#{n}"}
|
|
|
|
|
sequence(:track_id) { |n| "track_id-#{n}"}
|
|
|
|
|
sequence(:client_track_id) { |n| "client_track_id-#{n}"}
|
|
|
|
|
md5 'abc'
|
|
|
|
|
length 1
|
|
|
|
|
fully_uploaded true
|
|
|
|
|
association :user, factory: :user
|
|
|
|
|
association :recording, factory: :recording
|
2013-01-15 02:13:45 +00:00
|
|
|
end
|
|
|
|
|
|
2014-10-03 19:12:09 +00:00
|
|
|
factory :recorded_video, :class => JamRuby::RecordedVideo do
|
2014-10-10 16:07:36 +00:00
|
|
|
sequence(:client_video_source_id) { |n| "client_video_source_id-#{n}"}
|
|
|
|
|
fully_uploaded true
|
|
|
|
|
length 1
|
|
|
|
|
association :user, factory: :user
|
|
|
|
|
association :recording, factory: :recording
|
2014-10-03 19:12:09 +00:00
|
|
|
end
|
|
|
|
|
|
2013-01-15 02:13:45 +00:00
|
|
|
factory :instrument, :class => JamRuby::Instrument do
|
2014-02-06 21:53:19 +00:00
|
|
|
description { |n| "Instrument #{n}" }
|
2013-01-15 02:13:45 +00:00
|
|
|
end
|
2014-02-06 21:53:19 +00:00
|
|
|
|
2013-01-30 05:46:40 +00:00
|
|
|
factory :recording, :class => JamRuby::Recording do
|
2013-04-17 00:36:01 +00:00
|
|
|
|
2014-02-06 21:02:04 +00:00
|
|
|
association :owner, factory: :user
|
2014-05-06 21:17:26 +00:00
|
|
|
association :music_session, factory: :active_music_session
|
2014-04-08 17:15:49 +00:00
|
|
|
association :band, factory: :band
|
2014-02-06 21:02:04 +00:00
|
|
|
|
|
|
|
|
factory :recording_with_track do
|
|
|
|
|
before(:create) { |recording|
|
|
|
|
|
recording.recorded_tracks << FactoryGirl.create(:recorded_track, recording: recording, user: recording.owner)
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :claimed_recording, :class => JamRuby::ClaimedRecording do
|
|
|
|
|
sequence(:name) { |n| "name-#{n}" }
|
|
|
|
|
sequence(:description) { |n| "description-#{n}" }
|
|
|
|
|
is_public true
|
|
|
|
|
association :genre, factory: :genre
|
|
|
|
|
association :user, factory: :user
|
|
|
|
|
|
2014-11-06 17:26:13 +00:00
|
|
|
before(:create) { |claimed_recording, evaluator|
|
|
|
|
|
claimed_recording.recording = FactoryGirl.create(:recording_with_track, owner: claimed_recording.user) unless evaluator.recording
|
2014-02-06 21:02:04 +00:00
|
|
|
}
|
|
|
|
|
|
2014-02-24 16:55:56 +00:00
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :mix, :class => JamRuby::Mix do
|
2014-11-06 17:26:13 +00:00
|
|
|
ignore do
|
|
|
|
|
autowire true
|
|
|
|
|
end
|
2014-02-24 16:55:56 +00:00
|
|
|
started_at Time.now
|
|
|
|
|
completed_at Time.now
|
|
|
|
|
ogg_md5 'abc'
|
|
|
|
|
ogg_length 1
|
|
|
|
|
sequence(:ogg_url) { |n| "recordings/ogg/#{n}" }
|
|
|
|
|
mp3_md5 'abc'
|
|
|
|
|
mp3_length 1
|
|
|
|
|
sequence(:mp3_url) { |n| "recordings/mp3/#{n}" }
|
|
|
|
|
completed true
|
|
|
|
|
|
2014-11-06 17:26:13 +00:00
|
|
|
before(:create) {|mix, evaluator|
|
|
|
|
|
if evaluator.autowire
|
|
|
|
|
user = FactoryGirl.create(:user)
|
|
|
|
|
mix.recording = FactoryGirl.create(:recording_with_track, owner: user)
|
|
|
|
|
mix.recording.claimed_recordings << FactoryGirl.create(:claimed_recording, user: user, recording: mix.recording)
|
|
|
|
|
end
|
2014-02-24 16:55:56 +00:00
|
|
|
}
|
2013-01-30 05:46:40 +00:00
|
|
|
end
|
2013-03-15 04:22:31 +00:00
|
|
|
|
2014-10-23 04:10:49 +00:00
|
|
|
factory :quick_mix, :class => JamRuby::QuickMix do
|
|
|
|
|
ignore do
|
|
|
|
|
autowire true
|
|
|
|
|
end
|
|
|
|
|
started_at nil
|
|
|
|
|
completed_at nil
|
|
|
|
|
ogg_md5 nil
|
|
|
|
|
ogg_length 0
|
|
|
|
|
ogg_url nil
|
|
|
|
|
mp3_md5 nil
|
|
|
|
|
mp3_length 0
|
|
|
|
|
mp3_url nil
|
|
|
|
|
completed false
|
|
|
|
|
|
|
|
|
|
before(:create) {|mix, evaluator|
|
|
|
|
|
if evaluator.autowire
|
|
|
|
|
user = FactoryGirl.create(:user)
|
|
|
|
|
mix.user = user
|
|
|
|
|
mix.recording = FactoryGirl.create(:recording_with_track, owner: user)
|
|
|
|
|
mix.recording.claimed_recordings << FactoryGirl.create(:claimed_recording, user: user, recording: mix.recording)
|
|
|
|
|
end
|
|
|
|
|
}
|
2014-11-06 17:26:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
factory :quick_mix_completed do
|
|
|
|
|
started_at 1.minute.ago
|
|
|
|
|
completed_at Time.now
|
|
|
|
|
ogg_md5 'a'
|
|
|
|
|
ogg_length 1
|
|
|
|
|
ogg_url 'recordings/ogg'
|
|
|
|
|
mp3_md5 'a'
|
|
|
|
|
mp3_length 1
|
|
|
|
|
mp3_url 'recordings/mp3'
|
|
|
|
|
completed true
|
|
|
|
|
end
|
2014-10-23 04:10:49 +00:00
|
|
|
end
|
|
|
|
|
|
2013-03-15 04:22:31 +00:00
|
|
|
factory :invited_user, :class => JamRuby::InvitedUser do
|
|
|
|
|
sequence(:email) { |n| "user#{n}@someservice.com" }
|
|
|
|
|
autofriend false
|
|
|
|
|
end
|
|
|
|
|
|
2013-04-16 02:12:16 +00:00
|
|
|
factory :music_session_perf_data, :class => JamRuby::MusicSessionPerfData do
|
2013-04-17 00:36:01 +00:00
|
|
|
association :music_session => :music_session
|
2013-04-16 02:12:16 +00:00
|
|
|
end
|
2013-08-09 01:03:41 +00:00
|
|
|
|
|
|
|
|
factory :crash_dump, :class => JamRuby::CrashDump do
|
|
|
|
|
end
|
2013-11-03 03:07:16 +00:00
|
|
|
|
|
|
|
|
|
2014-01-04 09:10:58 +00:00
|
|
|
factory :promo_buzz, :class => JamRuby::PromoBuzz do
|
2014-01-17 04:51:19 +00:00
|
|
|
text_short Faker::Lorem.characters(10)
|
2014-01-04 09:10:58 +00:00
|
|
|
text_long Faker::Lorem.paragraphs(3).join("\n")
|
|
|
|
|
end
|
|
|
|
|
|
2014-01-17 04:51:19 +00:00
|
|
|
factory :icecast_limit, :class => JamRuby::IcecastLimit do
|
|
|
|
|
clients 5
|
|
|
|
|
sources 1
|
|
|
|
|
queue_size 102400
|
|
|
|
|
client_timeout 30
|
|
|
|
|
header_timeout 15
|
|
|
|
|
source_timeout 10
|
|
|
|
|
burst_size 65536
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_admin_authentication, :class => JamRuby::IcecastAdminAuthentication do
|
2014-01-19 02:20:44 +00:00
|
|
|
source_pass Faker::Lorem.characters(10)
|
2014-01-17 04:51:19 +00:00
|
|
|
admin_user Faker::Lorem.characters(10)
|
2014-01-19 02:20:44 +00:00
|
|
|
admin_pass Faker::Lorem.characters(10)
|
2014-01-17 04:51:19 +00:00
|
|
|
relay_user Faker::Lorem.characters(10)
|
2014-01-19 02:20:44 +00:00
|
|
|
relay_pass Faker::Lorem.characters(10)
|
2014-01-17 04:51:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_directory, :class => JamRuby::IcecastDirectory do
|
|
|
|
|
yp_url_timeout 15
|
|
|
|
|
yp_url Faker::Lorem.characters(10)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_master_server_relay, :class => JamRuby::IcecastMasterServerRelay do
|
|
|
|
|
master_server Faker::Lorem.characters(10)
|
|
|
|
|
master_server_port 8000
|
|
|
|
|
master_update_interval 120
|
|
|
|
|
master_username Faker::Lorem.characters(10)
|
2014-01-19 02:20:44 +00:00
|
|
|
master_pass Faker::Lorem.characters(10)
|
|
|
|
|
relays_on_demand 1
|
2014-01-17 04:51:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_path, :class => JamRuby::IcecastPath do
|
|
|
|
|
base_dir Faker::Lorem.characters(10)
|
|
|
|
|
log_dir Faker::Lorem.characters(10)
|
|
|
|
|
pid_file Faker::Lorem.characters(10)
|
|
|
|
|
web_root Faker::Lorem.characters(10)
|
|
|
|
|
admin_root Faker::Lorem.characters(10)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_logging, :class => JamRuby::IcecastLogging do
|
|
|
|
|
access_log Faker::Lorem.characters(10)
|
|
|
|
|
error_log Faker::Lorem.characters(10)
|
|
|
|
|
log_level 3
|
|
|
|
|
log_archive nil
|
|
|
|
|
log_size 10000
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_security, :class => JamRuby::IcecastSecurity do
|
2014-01-19 02:20:44 +00:00
|
|
|
chroot 0
|
2014-01-17 04:51:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_mount, :class => JamRuby::IcecastMount do
|
2014-01-19 02:20:44 +00:00
|
|
|
name "/" + Faker::Lorem.characters(10)
|
|
|
|
|
source_username Faker::Lorem.characters(10)
|
2014-01-21 14:51:03 +00:00
|
|
|
source_pass Faker::Lorem.characters(10)
|
2014-01-17 04:51:19 +00:00
|
|
|
max_listeners 100
|
|
|
|
|
max_listener_duration 3600
|
|
|
|
|
fallback_mount Faker::Lorem.characters(10)
|
2014-01-19 02:20:44 +00:00
|
|
|
fallback_override 1
|
|
|
|
|
fallback_when_full 1
|
2014-01-17 04:51:19 +00:00
|
|
|
is_public -1
|
|
|
|
|
stream_name Faker::Lorem.characters(10)
|
|
|
|
|
stream_description Faker::Lorem.characters(10)
|
|
|
|
|
stream_url Faker::Lorem.characters(10)
|
|
|
|
|
genre Faker::Lorem.characters(10)
|
2014-01-19 02:20:44 +00:00
|
|
|
hidden 0
|
2014-01-21 14:51:03 +00:00
|
|
|
association :server, factory: :icecast_server_with_overrides
|
2014-01-19 02:20:44 +00:00
|
|
|
|
|
|
|
|
factory :icecast_mount_with_auth do
|
|
|
|
|
association :authentication, :factory => :icecast_user_authentication
|
2014-01-21 14:51:03 +00:00
|
|
|
|
|
|
|
|
factory :iceast_mount_with_template do
|
|
|
|
|
association :mount_template, :factory => :icecast_mount_template
|
|
|
|
|
|
|
|
|
|
factory :iceast_mount_with_music_session do
|
2014-05-06 21:17:26 +00:00
|
|
|
association :music_session, :factory => :active_music_session
|
2014-01-21 14:51:03 +00:00
|
|
|
end
|
|
|
|
|
end
|
2014-01-19 02:20:44 +00:00
|
|
|
end
|
2014-01-21 14:51:03 +00:00
|
|
|
|
|
|
|
|
|
2014-01-17 04:51:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_listen_socket, :class => JamRuby::IcecastListenSocket do
|
|
|
|
|
port 8000
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_relay, :class => JamRuby::IcecastRelay do
|
|
|
|
|
port 8000
|
|
|
|
|
mount Faker::Lorem.characters(10)
|
|
|
|
|
server Faker::Lorem.characters(10)
|
2014-01-19 02:20:44 +00:00
|
|
|
on_demand 1
|
2014-01-17 04:51:19 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_user_authentication, :class => JamRuby::IcecastUserAuthentication do
|
|
|
|
|
authentication_type 'url'
|
2014-01-19 02:20:44 +00:00
|
|
|
unused_username Faker::Lorem.characters(10)
|
2014-01-21 14:51:03 +00:00
|
|
|
unused_pass Faker::Lorem.characters(10)
|
2014-01-17 04:51:19 +00:00
|
|
|
mount_add Faker::Lorem.characters(10)
|
|
|
|
|
mount_remove Faker::Lorem.characters(10)
|
|
|
|
|
listener_add Faker::Lorem.characters(10)
|
|
|
|
|
listener_remove Faker::Lorem.characters(10)
|
|
|
|
|
auth_header 'icecast-auth-user: 1'
|
|
|
|
|
timelimit_header 'icecast-auth-timelimit:'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :icecast_server, :class => JamRuby::IcecastServer do
|
2014-01-19 02:20:44 +00:00
|
|
|
sequence(:hostname) { |n| "hostname-#{n}"}
|
2014-01-25 20:03:14 +00:00
|
|
|
sequence(:server_id) { |n| "test-server-#{n}"}
|
2014-01-17 04:51:19 +00:00
|
|
|
|
|
|
|
|
factory :icecast_server_minimal do
|
2014-01-17 19:55:26 +00:00
|
|
|
association :template, :factory => :icecast_template_minimal
|
2014-01-21 14:51:03 +00:00
|
|
|
association :mount_template, :factory => :icecast_mount_template
|
2014-01-19 02:20:44 +00:00
|
|
|
|
|
|
|
|
factory :icecast_server_with_overrides do
|
|
|
|
|
association :limit, :factory => :icecast_limit
|
|
|
|
|
association :admin_auth, :factory => :icecast_admin_authentication
|
|
|
|
|
association :path, :factory => :icecast_path
|
|
|
|
|
association :logging, :factory => :icecast_logging
|
|
|
|
|
association :security, :factory => :icecast_security
|
|
|
|
|
|
|
|
|
|
before(:create) do |server|
|
|
|
|
|
server.listen_sockets << FactoryGirl.build(:icecast_listen_socket)
|
|
|
|
|
end
|
|
|
|
|
end
|
2014-01-17 19:55:26 +00:00
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2014-01-21 14:51:03 +00:00
|
|
|
factory :icecast_mount_template, :class => JamRuby::IcecastMountTemplate do
|
|
|
|
|
sequence(:name) { |n| "name-#{n}"}
|
|
|
|
|
source_username Faker::Lorem.characters(10)
|
|
|
|
|
source_pass Faker::Lorem.characters(10)
|
|
|
|
|
max_listeners 100
|
|
|
|
|
max_listener_duration 3600
|
|
|
|
|
fallback_mount Faker::Lorem.characters(10)
|
|
|
|
|
fallback_override 1
|
|
|
|
|
fallback_when_full 1
|
|
|
|
|
is_public -1
|
|
|
|
|
stream_name Faker::Lorem.characters(10)
|
|
|
|
|
stream_description Faker::Lorem.characters(10)
|
|
|
|
|
stream_url Faker::Lorem.characters(10)
|
|
|
|
|
genre Faker::Lorem.characters(10)
|
|
|
|
|
hidden 0
|
|
|
|
|
association :authentication, :factory => :icecast_user_authentication
|
|
|
|
|
end
|
|
|
|
|
|
2014-03-05 06:40:04 +00:00
|
|
|
factory :icecast_template, :class => JamRuby::IcecastTemplate do
|
|
|
|
|
|
|
|
|
|
sequence(:name) { |n| "name-#{n}"}
|
|
|
|
|
sequence(:location) { |n| "location-#{n}"}
|
|
|
|
|
|
|
|
|
|
factory :icecast_template_minimal do
|
|
|
|
|
association :limit, :factory => :icecast_limit
|
|
|
|
|
association :admin_auth, :factory => :icecast_admin_authentication
|
|
|
|
|
association :path, :factory => :icecast_path
|
|
|
|
|
association :logging, :factory => :icecast_logging
|
|
|
|
|
association :security, :factory => :icecast_security
|
|
|
|
|
|
|
|
|
|
before(:create) do |template|
|
|
|
|
|
template.listen_sockets << FactoryGirl.build(:icecast_listen_socket)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
2014-02-03 21:19:14 +00:00
|
|
|
factory :facebook_signup, :class => JamRuby::FacebookSignup do
|
|
|
|
|
sequence(:lookup_id) { |n| "lookup-#{n}"}
|
|
|
|
|
sequence(:first_name) { |n| "first-#{n}"}
|
|
|
|
|
sequence(:last_name) { |n| "last-#{n}"}
|
|
|
|
|
gender 'M'
|
|
|
|
|
sequence(:email) { |n| "jammin-#{n}@jamkazam.com"}
|
|
|
|
|
sequence(:uid) { |n| "uid-#{n}"}
|
|
|
|
|
sequence(:token) { |n| "token-#{n}"}
|
|
|
|
|
token_expires_at Time.now
|
|
|
|
|
end
|
2014-02-17 23:26:17 +00:00
|
|
|
|
2014-11-06 17:26:13 +00:00
|
|
|
|
|
|
|
|
factory :recording_comment, :class => JamRuby::RecordingComment do
|
|
|
|
|
sequence(:comment) { |n| "comment-#{n}" }
|
|
|
|
|
association :recording, factory: :recording
|
|
|
|
|
association :user, factory: :recording
|
|
|
|
|
end
|
|
|
|
|
|
2014-03-05 06:40:04 +00:00
|
|
|
factory :playable_play, :class => JamRuby::PlayablePlay do
|
2014-02-18 13:34:51 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :recording_like, :class => JamRuby::RecordingLiker do
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :music_session_like, :class => JamRuby::MusicSessionLiker do
|
2014-02-17 23:26:17 +00:00
|
|
|
|
|
|
|
|
end
|
2014-03-09 22:58:57 +00:00
|
|
|
|
|
|
|
|
factory :event, :class => JamRuby::Event do
|
|
|
|
|
sequence(:slug) { |n| "slug-#{n}" }
|
|
|
|
|
title 'event title'
|
|
|
|
|
description 'event description'
|
2014-03-10 06:31:20 +00:00
|
|
|
end
|
2014-03-09 22:58:57 +00:00
|
|
|
|
2014-03-10 06:31:20 +00:00
|
|
|
factory :event_session, :class => JamRuby::EventSession do
|
2014-03-09 22:58:57 +00:00
|
|
|
end
|
2014-03-18 15:07:45 +00:00
|
|
|
|
|
|
|
|
factory :email_batch, :class => JamRuby::EmailBatch do
|
|
|
|
|
subject Faker::Lorem.sentence
|
2014-03-18 18:33:48 +00:00
|
|
|
body "#{JamRuby::EmailBatch::VAR_FIRST_NAME} " + Faker::Lorem.paragraphs(3).join("\n")
|
2014-03-18 15:07:45 +00:00
|
|
|
test_emails 4.times.collect { Faker::Internet.safe_email }.join(',')
|
|
|
|
|
end
|
|
|
|
|
|
2014-05-16 07:58:06 +00:00
|
|
|
factory :email_batch_new_musician, :class => JamRuby::EmailBatchNewMusician do
|
2014-05-18 00:12:01 +00:00
|
|
|
end
|
2014-05-16 07:58:06 +00:00
|
|
|
|
2014-05-18 00:12:01 +00:00
|
|
|
factory :email_batch_progression, :class => JamRuby::EmailBatchProgression do
|
2014-05-16 07:58:06 +00:00
|
|
|
end
|
|
|
|
|
|
2014-05-29 07:19:55 +00:00
|
|
|
factory :email_batch_scheduled_session, :class => JamRuby::EmailBatchScheduledSessions do
|
|
|
|
|
end
|
|
|
|
|
|
2014-03-20 11:53:26 +00:00
|
|
|
factory :notification, :class => JamRuby::Notification do
|
|
|
|
|
|
|
|
|
|
factory :notification_text_message do
|
|
|
|
|
description 'TEXT_MESSAGE'
|
|
|
|
|
message Faker::Lorem.characters(10)
|
|
|
|
|
end
|
|
|
|
|
end
|
2014-04-30 03:01:28 +00:00
|
|
|
|
|
|
|
|
factory :diagnostic, :class => JamRuby::Diagnostic do
|
|
|
|
|
type JamRuby::Diagnostic::NO_HEARTBEAT_ACK
|
|
|
|
|
creator JamRuby::Diagnostic::CLIENT
|
|
|
|
|
data Faker::Lorem.sentence
|
|
|
|
|
end
|
2014-05-14 20:48:42 +00:00
|
|
|
|
|
|
|
|
factory :rsvp_slot, class: JamRuby::RsvpSlot do
|
2014-06-17 19:10:24 +00:00
|
|
|
|
2014-05-14 20:48:42 +00:00
|
|
|
proficiency_level 'beginner'
|
2014-06-24 15:33:31 +00:00
|
|
|
instrument { Instrument.find('electric guitar') }
|
2014-06-17 19:10:24 +00:00
|
|
|
|
|
|
|
|
factory :chosen_rsvp_slot do
|
|
|
|
|
ignore do
|
|
|
|
|
user nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
after(:create) { |rsvp_slot, evaluator|
|
|
|
|
|
rsvp_request = FactoryGirl.create(:rsvp_request, user: evaluator.user)
|
|
|
|
|
rsvp_request_rsvp_slot = FactoryGirl.create(:rsvp_request_rsvp_slot, chosen:true, rsvp_request: rsvp_request, rsvp_slot:rsvp_slot)
|
|
|
|
|
}
|
|
|
|
|
end
|
2014-05-14 20:48:42 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :rsvp_request, class: JamRuby::RsvpRequest do
|
|
|
|
|
canceled false
|
2014-06-07 17:01:03 +00:00
|
|
|
cancel_all false
|
2014-07-10 20:22:00 +00:00
|
|
|
association :user, :factory => :user
|
|
|
|
|
|
2014-07-10 20:57:48 +00:00
|
|
|
# creates *number* slots for a new rsvp_request (the case were you are too lazy / don't care to set up slots)
|
2014-07-10 20:22:00 +00:00
|
|
|
factory :rsvp_request_for_multiple_slots do
|
|
|
|
|
ignore do
|
|
|
|
|
music_session nil
|
2014-07-10 20:57:48 +00:00
|
|
|
number 1
|
|
|
|
|
chosen nil
|
2014-07-10 20:22:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
after(:create) { |rsvp_request, evaluator |
|
|
|
|
|
evaluator.number.times do |i|
|
|
|
|
|
slot = FactoryGirl.create(:rsvp_slot, music_session: evaluator.music_session, instrument: Instrument.order(:id).limit(1).offset(i).first, proficiency_level: 1)
|
2014-07-10 20:57:48 +00:00
|
|
|
FactoryGirl.create(:rsvp_request_rsvp_slot, chosen: evaluator.chosen, rsvp_request: rsvp_request, rsvp_slot:slot)
|
|
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# creates a rsvp_request for the specified slots (helps when you already have a slot(s), and need to request to them)
|
|
|
|
|
factory :rsvp_request_for_slots do
|
|
|
|
|
ignore do
|
|
|
|
|
slots nil
|
|
|
|
|
chosen nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
after(:create) { |rsvp_request, evaluator |
|
|
|
|
|
evaluator.slots.each do |slot|
|
|
|
|
|
FactoryGirl.create(:rsvp_request_rsvp_slot, chosen:evaluator.chosen, rsvp_request: rsvp_request, rsvp_slot:slot)
|
2014-07-10 20:22:00 +00:00
|
|
|
end
|
|
|
|
|
}
|
|
|
|
|
end
|
2014-05-21 04:57:32 +00:00
|
|
|
end
|
2014-05-31 11:41:59 +00:00
|
|
|
|
2014-06-17 19:10:24 +00:00
|
|
|
factory :rsvp_request_rsvp_slot, class: JamRuby::RsvpRequestRsvpSlot do
|
|
|
|
|
chosen false
|
|
|
|
|
end
|
|
|
|
|
|
2014-05-16 19:39:37 +00:00
|
|
|
factory :latency_tester, :class => JamRuby::LatencyTester do
|
2014-05-19 13:46:03 +00:00
|
|
|
ignore do
|
|
|
|
|
connection nil
|
|
|
|
|
make_connection true
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
sequence(:client_id) { |n| "LatencyTesterClientId-#{n}" }
|
|
|
|
|
|
|
|
|
|
after(:create) do |latency_tester, evaluator|
|
|
|
|
|
latency_tester.connection = evaluator.connection if evaluator.connection
|
|
|
|
|
latency_tester.connection = FactoryGirl.create(:connection, client_type: Connection::TYPE_LATENCY_TESTER, client_id: latency_tester.client_id) if evaluator.make_connection
|
|
|
|
|
latency_tester.save
|
|
|
|
|
end
|
2014-05-16 19:39:37 +00:00
|
|
|
end
|
2014-07-14 20:53:04 +00:00
|
|
|
|
|
|
|
|
factory :max_mind_release, :class => JamRuby::MaxMindRelease do
|
|
|
|
|
released_at Time.now.to_date
|
|
|
|
|
end
|
2014-11-04 20:55:12 +00:00
|
|
|
|
|
|
|
|
factory :jam_track_licensor, :class => JamRuby::JamTrackLicensor do
|
|
|
|
|
sequence(:name) { |n| "licensor-#{n}" }
|
|
|
|
|
sequence(:description) { |n| "description-#{n}" }
|
|
|
|
|
sequence(:attention) { |n| "attention-#{n}" }
|
|
|
|
|
sequence(:address_line_1) { |n| "address1-#{n}" }
|
|
|
|
|
sequence(:address_line_2) { |n| "address2-#{n}" }
|
|
|
|
|
sequence(:city) { |n| "city-#{n}" }
|
|
|
|
|
sequence(:state) { |n| "state-#{n}" }
|
|
|
|
|
sequence(:zip_code) { |n| "zipcode-#{n}" }
|
|
|
|
|
sequence(:contact) { |n| "contact-#{n}" }
|
|
|
|
|
sequence(:email) { |n| "email-#{n}" }
|
|
|
|
|
sequence(:phone) { |n| "phone-#{n}" }
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :jam_track, :class => JamRuby::JamTrack do
|
|
|
|
|
sequence(:name) { |n| "jam-track-#{n}" }
|
|
|
|
|
sequence(:description) { |n| "description-#{n}" }
|
|
|
|
|
bpm 100.1
|
|
|
|
|
time_signature '4/4'
|
|
|
|
|
status 'Production'
|
|
|
|
|
recording_type 'Cover'
|
|
|
|
|
sequence(:original_artist) { |n| "original-artist-#{n}" }
|
|
|
|
|
sequence(:songwriter) { |n| "songwriter-#{n}" }
|
|
|
|
|
sequence(:publisher) { |n| "publisher-#{n}" }
|
|
|
|
|
pro 'ASCAP'
|
|
|
|
|
sales_region 'United States'
|
|
|
|
|
price 1.99
|
|
|
|
|
reproduction_royalty true
|
|
|
|
|
public_performance_royalty true
|
|
|
|
|
reproduction_royalty_amount 0.999
|
|
|
|
|
licensor_royalty_amount 0.999
|
|
|
|
|
pro_royalty_amount 0.999
|
|
|
|
|
|
|
|
|
|
genre JamRuby::Genre.first
|
|
|
|
|
association :licensor, factory: :jam_track_licensor
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :jam_track_track, :class => JamRuby::JamTrackTrack do
|
|
|
|
|
position 1
|
|
|
|
|
part 'lead guitar'
|
|
|
|
|
track_type 'Track'
|
|
|
|
|
instrument JamRuby::Instrument.find('electric guitar')
|
|
|
|
|
association :jam_track, factory: :jam_track
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
factory :jam_track_right, :class => JamRuby::JamTrackRight do
|
|
|
|
|
association :jam_track, factory: :jam_track
|
|
|
|
|
association :user, factory: :user
|
|
|
|
|
end
|
2014-03-10 06:31:20 +00:00
|
|
|
end
|