diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2017-09-09 16:54:50 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2017-09-09 16:56:06 +0200 |
commit | 032d46f65ac3bbfe5c05f96e6b68d0dfe2a4aa3d (patch) | |
tree | 3c9d5c6ee730730c8e281def9582974c1ec134de /spec | |
parent | a147a9a6c761d5d867c24bbea09f4d558591e07c (diff) | |
download | norsk-urskog-registrations-032d46f65ac3bbfe5c05f96e6b68d0dfe2a4aa3d.tar.gz norsk-urskog-registrations-032d46f65ac3bbfe5c05f96e6b68d0dfe2a4aa3d.tar.bz2 norsk-urskog-registrations-032d46f65ac3bbfe5c05f96e6b68d0dfe2a4aa3d.zip |
Split contact address into street, postcode and city.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/register_band_spec.rb | 4 | ||||
-rw-r--r-- | spec/registration_spec.rb | 4 | ||||
-rw-r--r-- | spec/support/band_factory.rb | 8 | ||||
-rw-r--r-- | spec/support/submit_form_helper.rb | 4 |
4 files changed, 14 insertions, 6 deletions
diff --git a/spec/features/register_band_spec.rb b/spec/features/register_band_spec.rb index f75315d..5d812bc 100644 --- a/spec/features/register_band_spec.rb +++ b/spec/features/register_band_spec.rb @@ -47,7 +47,9 @@ feature "Submit registration form" do within ('#form-contact-info') do expect(find_field('Navn:').value).to eql(@band_params['contact']['name']) - expect(find_field('Postadresse:').value.gsub("\r\n", "\n")).to eql(@band_params['contact']['addr']) + expect(find_field('Adresse:').value).to eql(@band_params['contact']['street']) + expect(find_field('Postnr:').value).to eql(@band_params['contact']['postcode']) + expect(find_field('Sted:').value).to eql(@band_params['contact']['city']) expect(find_field('Tlf:').value).to eql(@band_params['contact']['phone']) expect(find_field('E-post:').value).to eql(@band_params['contact']['email']) end diff --git a/spec/registration_spec.rb b/spec/registration_spec.rb index d1875d7..9dc7616 100644 --- a/spec/registration_spec.rb +++ b/spec/registration_spec.rb @@ -87,7 +87,7 @@ describe RegistrationApp do expect(last_response).to match(/Kort bio\: #{band_params['shortbio']}/) expect(last_response).to match(/Kontaktperson: #{band_params['contact']['name']}/) - expect(last_response).to match(/Kontaktadresse: #{band_params['contact']['addr']}/) + expect(last_response).to match(/Kontaktadresse: #{band_params['contact']['street']}, #{band_params['contact']['postcode']} #{band_params['contact']['city']}/) expect(last_response).to match(/Telefon: #{band_params['contact']['phone']}/) expect(last_response).to match(/Epost: #{band_params['contact']['email']}/) @@ -157,7 +157,7 @@ describe RegistrationApp do end context 'with no contact address' do - include_examples('form with errors', {:contact_addr => ''}) + include_examples('form with errors', {:contact_city => '', :contact_postcode => '', :contact_street => ''}) end context 'with no contact phone' do diff --git a/spec/support/band_factory.rb b/spec/support/band_factory.rb index 3ae2589..b092653 100644 --- a/spec/support/band_factory.rb +++ b/spec/support/band_factory.rb @@ -8,7 +8,9 @@ module BandFactory :label => 'A Record Label', :bio => 'A short bio about the band', :contact_name => 'Contact Name', - :contact_addr => "Streetname 666\n1234Someplace Nice", + :contact_street => "Streetname 666", + :contact_postcode => "1234", + :contact_city => "Someplace Nice", :contact_phone => '98765432', :contact_email => 'band@example.com', :members => "Member 1 (Instrument 1, 24\nMember 2 (Instrument 2)\nMember 3", @@ -24,7 +26,9 @@ module BandFactory 'shortbio' => opts[:bio], 'contact' => { 'name' => opts[:contact_name], - 'addr' => opts[:contact_addr], + 'street' => opts[:contact_street], + 'postcode' => opts[:contact_postcode], + 'city' => opts[:contact_city], 'phone' => opts[:contact_phone], 'email' => opts[:contact_email] }, diff --git a/spec/support/submit_form_helper.rb b/spec/support/submit_form_helper.rb index 30816cf..b9a64aa 100644 --- a/spec/support/submit_form_helper.rb +++ b/spec/support/submit_form_helper.rb @@ -9,7 +9,9 @@ module SubmitFormHelper within '#form-contact-info' do fill_in 'Navn:', with: params['contact']['name'] - fill_in 'Postadresse:', with: params['contact']['addr'] + fill_in 'Adresse:', with: params['contact']['street'] + fill_in 'Postnr:', with: params['contact']['postcode'] + fill_in 'Sted:', with: params['contact']['city'] fill_in 'Tlf:', with: params['contact']['phone'] fill_in 'E-post:', with: params['contact']['email'] end |