summaryrefslogtreecommitdiffstats
path: root/spec/support/band_factory.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/band_factory.rb')
-rw-r--r--spec/support/band_factory.rb15
1 files changed, 2 insertions, 13 deletions
diff --git a/spec/support/band_factory.rb b/spec/support/band_factory.rb
index 56993fa..3ae2589 100644
--- a/spec/support/band_factory.rb
+++ b/spec/support/band_factory.rb
@@ -11,11 +11,7 @@ module BandFactory
:contact_addr => "Streetname 666\n1234Someplace Nice",
:contact_phone => '98765432',
:contact_email => 'band@example.com',
- :members => [
- { :name => 'Member 1', :instrument => 'Instrument 1', :age => '24' },
- { :name => 'Member 2', :instrument => 'Instrument 2', :age => '0' },
- { :name => 'Member 3', :instrument => '', :age => '' },
- ],
+ :members => "Member 1 (Instrument 1, 24\nMember 2 (Instrument 2)\nMember 3",
}.merge(options)
num_songs = opts.delete(:songs)
@@ -32,17 +28,10 @@ module BandFactory
'phone' => opts[:contact_phone],
'email' => opts[:contact_email]
},
- 'members' => {},
+ 'members' => opts[:members],
'songs' => {}
}
- (1..opts[:members].length).each do |i|
- params['members'][i.to_s] = {}
- params['members'][i.to_s]['name'] = opts[:members][i-1][:name]
- params['members'][i.to_s]['instrument'] = opts[:members][i-1][:instrument]
- params['members'][i.to_s]['age'] = opts[:members][i-1][:age]
- end
-
(1..num_songs).each do |i|
num = i.to_s
params['songs'][num] = create_song_params