From 5c36e7c3247c205b2bc2455f95f38fe01616498e Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Tue, 6 Oct 2015 20:18:11 +0200 Subject: Test that we get an error message when submitting an empty form --- lib/band.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/band.rb b/lib/band.rb index 49180d8..ac0a9db 100644 --- a/lib/band.rb +++ b/lib/band.rb @@ -17,8 +17,10 @@ class Band @contact = Contact.new(params['contact']) @members = [] - params['members'].each do |k, m| - @members << Member.new(m) + if params['members'] + params['members'].each do |k, m| + @members << Member.new(m) + end end @songs = [] -- cgit v1.2.3