summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-30 14:32:07 +0100
committerHarald Eilertsen <haraldei@anduin.net>2015-10-30 14:32:07 +0100
commit55983d657c857077ff0144e4c18d84194597b67e (patch)
treec35dd792c6b4eb812f90eaf904bfa55313112488
parent90f4ed34c62f5d90b536cac97265d323d0c1c136 (diff)
downloadnorsk-urskog-registrations-55983d657c857077ff0144e4c18d84194597b67e.tar.gz
norsk-urskog-registrations-55983d657c857077ff0144e4c18d84194597b67e.tar.bz2
norsk-urskog-registrations-55983d657c857077ff0144e4c18d84194597b67e.zip
Simplify form: Don't mess with adding songs, display them all at once.
-rw-r--r--registration.rb1
-rw-r--r--spec/registration_spec.rb4
-rw-r--r--spec/support/submit_form_helper.rb2
-rw-r--r--views/index.erb6
4 files changed, 3 insertions, 10 deletions
diff --git a/registration.rb b/registration.rb
index 3aea657..009406a 100644
--- a/registration.rb
+++ b/registration.rb
@@ -11,6 +11,7 @@ class RegistrationApp < Sinatra::Base
get '/' do
@band = Band.new
+ 3.times { @band.songs << Song.new }
erb :index
end
diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb
index fbd2016..96ae18f 100644
--- a/spec/registration_spec.rb
+++ b/spec/registration_spec.rb
@@ -20,10 +20,6 @@ describe RegistrationApp do
it 'displays the registration form' do
expect(last_response.body).to match(/form id="registration-form"/)
end
-
- it 'displays the add song button' do
- expect(last_response.body).to match(/id="add-song-button"/)
- end
end
describe 'POST submit' do
diff --git a/spec/support/submit_form_helper.rb b/spec/support/submit_form_helper.rb
index 45e7d67..3d881cb 100644
--- a/spec/support/submit_form_helper.rb
+++ b/spec/support/submit_form_helper.rb
@@ -15,8 +15,6 @@ module SubmitFormHelper
end
if params['songs']
- click_on 'Legg til låt'
-
within '#form-songs #song-1-info' do
fill_in 'Tittel:', with: params['songs']['1']['title']
fill_in 'Lengde:', with: params['songs']['1']['time']
diff --git a/views/index.erb b/views/index.erb
index ab3a762..9b39a9e 100644
--- a/views/index.erb
+++ b/views/index.erb
@@ -66,10 +66,8 @@
nøye med å oppgi riktige navn (ingen pseudonymer) på utøvere og komponister, da vi sjekker dette
opp imot TONO/NCB for å sikre at evt. vederlag blir betalt riktig.</p>
- <input type="button" name="add_song" value="Legg til låt" id="add-song-button">
-
- <% @band.songs.each do |s| %>
- <%= erb :song, layout: false, locals: { song_number: 1, song: s } %>
+ <% @band.songs.each_index do |i| %>
+ <%= erb :song, layout: false, locals: { song_number: i, song: @band.songs[i] } %>
<% end %>
</div>