From 57a52a31486ec9af415d6d5b86a20a4a62abf488 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 1 Nov 2015 15:55:50 +0100 Subject: Fix numbering of song forms. --- spec/registration_spec.rb | 6 ++++++ views/index.erb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb index 3111ebc..522b155 100644 --- a/spec/registration_spec.rb +++ b/spec/registration_spec.rb @@ -20,6 +20,12 @@ describe RegistrationApp do it 'displays the registration form' do expect(last_response.body).to match(/form id="registration-form"/) end + + it 'allows three songs' do + expect(last_response.body).to match(/Låt nr. 1/) + expect(last_response.body).to match(/Låt nr. 2/) + expect(last_response.body).to match(/Låt nr. 3/) + end end describe 'POST submit' do diff --git a/views/index.erb b/views/index.erb index f031838..65b8653 100644 --- a/views/index.erb +++ b/views/index.erb @@ -84,7 +84,7 @@

Låter

<% @band.songs.each_index do |i| %> - <%= erb :song, layout: false, locals: { song_number: i, song: @band.songs[i] } %> + <%= erb :song, layout: false, locals: { song_number: i + 1, song: @band.songs[i] } %> <% end %> -- cgit v1.2.3