summaryrefslogtreecommitdiffstats
path: root/spec/support/band_factory.rb
blob: f14caf215be44a943071bfb013a92976a58c6d90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module BandFactory
  def create_band_params(options = {})
    opts = {
      :songs => 1,
    }.merge(options)

    num_songs = opts.delete(:songs)

    params = {
      'name' => 'Imbalance',
      'city' => 'Oslo',
      'website' => 'http://imbalance.no',
      'label' => 'Calculated Imperfection',
      'shortbio' => 'Thrash metal from Norway',
      'contact' => {
        'name' => 'Harald Eilertsen',
        'addr' => "Gamleveien 13\n1289 Snufstad",
        'phone' => '98765432',
        'email' => 'mail@imbalance.no'
      },
      'members' => {
        '1' => {
          'name' => 'Harald Eilertsen',
          'instrument' => 'Bass/Vocals',
          'age' => ''
        },
        '2' => {
          'name' => 'Welle',
          'instrument' => 'Drums',
          'age' => ''
        },
        '3' => {
          'name' => 'Thormodr',
          'instrument' => 'Guitar',
          'age' => ''
        }
      },
      'songs' => {}
    }

    (1..num_songs).each do |i|
      num = i.to_s
      params['songs'][num] = create_song_params
    end

    params
  end

  def create_song_params
    {
      'title' => 'Bestial by Nature',
      'time' => '02:80',
      'isrc' => '',
      'performers' => "Harald Eilertsen\nThormod Steinert\nLars Welle",
      'composers' => "Harald Eilertsen\nThormod Steinert",
      'notes' => 'Rævrukkje rum kjurr!'
    }
  end
end