summaryrefslogtreecommitdiffstats
path: root/spec/features
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2015-10-15 10:11:56 +0200
committerHarald Eilertsen <haraldei@anduin.net>2015-10-28 21:32:17 +0100
commit57af2ee2e51b614ac6e2fa81b1075a55d3c0c252 (patch)
tree81731790772b47e444b8a1abb70abdec543da2dd /spec/features
parentc69ab8c2bc8dfa59070249dd434219d83a792dbc (diff)
downloadnorsk-urskog-registrations-57af2ee2e51b614ac6e2fa81b1075a55d3c0c252.tar.gz
norsk-urskog-registrations-57af2ee2e51b614ac6e2fa81b1075a55d3c0c252.tar.bz2
norsk-urskog-registrations-57af2ee2e51b614ac6e2fa81b1075a55d3c0c252.zip
Retain member and song info on errors in form.
Diffstat (limited to 'spec/features')
-rw-r--r--spec/features/register_band_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/features/register_band_spec.rb b/spec/features/register_band_spec.rb
index 92bf9d3..625cb20 100644
--- a/spec/features/register_band_spec.rb
+++ b/spec/features/register_band_spec.rb
@@ -30,7 +30,7 @@ feature "Submit registration form" do
context "with invalid data" do
scenario "retains submitted data in form", js: true do
- @band_params['songs'] = nil
+ @band_params['name'] = ""
fill_in_form_with(@band_params)
expect(find_field('Bandnavn:').value).to eql(@band_params['name'])
@@ -48,6 +48,17 @@ feature "Submit registration form" do
within '#form-members .member-info' do
expect(find_field('Navn:').value).to eql(@band_params['members']['1']['name'])
+ expect(find_field('Instrument:').value).to eql(@band_params['members']['1']['instrument'])
+ expect(find_field('Alder:').value).to eql(@band_params['members']['1']['age'])
+ end
+
+ within '#form-songs #song-1-info' do
+ expect(find_field('Tittel:').value).to eql(@band_params['songs']['1']['title'])
+ expect(find_field('Lengde:').value).to eql(@band_params['songs']['1']['time'])
+ expect(find_field('ISRC-kode:').value).to eql(@band_params['songs']['1']['isrc'])
+ expect(find_field('Utøvere:').value).to eql(@band_params['songs']['1']['performers'])
+ expect(find_field('Opphavsmenn:').value).to eql(@band_params['songs']['1']['composers'])
+ expect(find_field('Andre merknader:').value).to eql(@band_params['songs']['1']['notes'])
end
end
end