From a93aba5967c14cb965390938d871eb83f556929e Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Thu, 6 Apr 2017 16:15:45 +0200 Subject: [PATCH 1/2] Update poltergeist --- Gemfile.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 40665e46f..c627a8b96 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -69,7 +69,7 @@ GEM i18n (~> 0.7) minitest (~> 5.1) tzinfo (~> 1.1) - addressable (2.5.0) + addressable (2.5.1) public_suffix (~> 2.0, >= 2.0.2) apipie-rails (0.3.7) json @@ -97,7 +97,7 @@ GEM browser (2.3.0) builder (3.2.3) byebug (9.0.6) - capybara (2.11.0) + capybara (2.13.0) addressable mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -413,7 +413,7 @@ GEM json orm_adapter (0.5.0) pg (0.19.0) - poltergeist (1.12.0) + poltergeist (1.14.0) capybara (~> 2.1) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) @@ -424,7 +424,7 @@ GEM pry-byebug (3.4.2) byebug (~> 9.0) pry (~> 0.10) - public_suffix (2.0.4) + public_suffix (2.0.5) rack (2.0.1) rack-handlers (0.7.3) rack @@ -626,7 +626,7 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) hashdiff - websocket-driver (0.6.4) + websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.2) will_paginate (3.1.5) From 86ab596a87ac77ddb550a414f5ac620f2ab4073c Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Thu, 6 Apr 2017 16:58:00 +0200 Subject: [PATCH 2/2] Change test structure --- .../drawing_a_zone_with_freedraw_spec.rb | 23 ++++++++++++++----- spec/features/users/list_dossiers_spec.rb | 1 - 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/spec/features/users/drawing_a_zone_with_freedraw_spec.rb b/spec/features/users/drawing_a_zone_with_freedraw_spec.rb index b7a4f8495..3cbd1c26e 100644 --- a/spec/features/users/drawing_a_zone_with_freedraw_spec.rb +++ b/spec/features/users/drawing_a_zone_with_freedraw_spec.rb @@ -15,13 +15,24 @@ feature 'drawing a zone with freedraw' do expect(page).to have_css('#login_user') end - context 'when he enter login information' do + scenario 'he logs in and he is redirected to carte page', vcr: { cassette_name: 'drawing_a_zone_with_freedraw_redirected_to_carte_page' } do + within('#new_user') do + page.find_by_id('user_email').set user.email + page.find_by_id('user_password').set user.password + page.click_on 'Se connecter' + end + expect(page).to have_css('.content #map') + end + end + + context 'when user is logged in' do + before do + login_as user, scope: :user + end + + context 'when he is visiting the map page' do before do - within('#new_user') do - page.find_by_id('user_email').set user.email - page.find_by_id('user_password').set user.password - page.click_on 'Se connecter' - end + visit users_dossier_carte_path dossier_id: dossier.id end context 'when procedure have api carto activated' do diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/features/users/list_dossiers_spec.rb index d970de7b4..1ae783994 100644 --- a/spec/features/users/list_dossiers_spec.rb +++ b/spec/features/users/list_dossiers_spec.rb @@ -1,7 +1,6 @@ require 'spec_helper' feature 'user access to the list of his dossier' do - let(:user) { create(:user) } let!(:last_updated_dossier) { create(:dossier, :with_entreprise, user: user, state: 'replied')} let!(:dossier1) { create(:dossier, :with_entreprise, user: user, state: 'replied') }