diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d5f8f67a..47554ed09 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: - bin/rspec spec/controllers/*_spec.rb - bin/rspec spec/controllers/[a-l]**/*_spec.rb - bin/rspec spec/controllers/[m-z]**/*_spec.rb - - bin/rspec spec/features + - bin/rspec spec/system - bin/rspec spec/helpers spec/lib spec/middlewares - bin/rspec spec/mailers spec/jobs spec/policies - bin/rspec spec/models diff --git a/.rubocop.yml b/.rubocop.yml index d1e5ce5f6..7c7982b4b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -722,7 +722,7 @@ Rails/DelegateAllowBlank: Rails/DynamicFindBy: Enabled: true Exclude: - - "spec/features/**/*.rb" + - "spec/system/**/*.rb" Rails/EnumUniqueness: Enabled: true diff --git a/Gemfile b/Gemfile index 33cc8f5c0..5fbc1aa53 100644 --- a/Gemfile +++ b/Gemfile @@ -89,11 +89,10 @@ group :test do gem 'capybara' # Integration testing gem 'capybara-email' # Access emails during integration tests gem 'capybara-screenshot' # Save a dump of the page when an integration test fails - gem 'capybara-selenium' - gem 'database_cleaner' gem 'factory_bot' gem 'launchy' gem 'rails-controller-testing' + gem 'selenium-webdriver' gem 'shoulda-matchers', require: false gem 'timecop' gem 'vcr' diff --git a/Gemfile.lock b/Gemfile.lock index 867650789..c06ad62b4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -162,9 +162,6 @@ GEM capybara-screenshot (1.0.25) capybara (>= 1.0, < 4) launchy - capybara-selenium (0.0.6) - capybara - selenium-webdriver case_transform (0.2) activesupport caxlsx (3.1.0) @@ -189,12 +186,6 @@ GEM css_parser (1.9.0) addressable daemons (1.3.1) - database_cleaner (2.0.1) - database_cleaner-active_record (~> 2.0.0) - database_cleaner-active_record (2.0.0) - activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) - database_cleaner-core (2.0.1) datetime_picker_rails (0.0.7) momentjs-rails (>= 2.8.1) deep_cloneable (3.0.0) @@ -798,13 +789,11 @@ DEPENDENCIES capybara capybara-email capybara-screenshot - capybara-selenium charlock_holmes chartkick chunky_png clamav-client daemons - database_cleaner deep_cloneable delayed_cron_job delayed_job_active_record @@ -874,6 +863,7 @@ DEPENDENCIES sanitize-url sassc-rails scss_lint + selenium-webdriver sentry-delayed_job sentry-rails sentry-ruby diff --git a/Guardfile b/Guardfile index 24a9eca3b..30cfad9f1 100644 --- a/Guardfile +++ b/Guardfile @@ -2,7 +2,7 @@ # More info at https://github.com/guard/guard#readme ## Uncomment and set this to only include directories you want to watch -# directories %w(app lib config test spec features) \ +# directories %w(app lib config test spec system) \ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")} ## Note: if you are using the `directories` clause above and you are not @@ -77,8 +77,8 @@ guard :rspec, cmd: 'spring rspec' do watch('app/controllers/application_controller.rb') { "spec/controllers" } watch('spec/rails_helper.rb') { "spec" } - # Capybara features specs - watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" } + # Capybara system specs + watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/system/#{m[1]}_spec.rb" } # Turnip features and steps watch(%r{^spec/acceptance/(.+)\.feature$}) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 5141112b9..705f4d462 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -58,7 +58,7 @@ RSpec.configure do |config| # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false # instead of true. - config.use_transactional_fixtures = false + config.use_transactional_fixtures = true # RSpec Rails can automatically mix in different behaviours to your tests # based on their file location, for example enabling you to call `get` and @@ -127,4 +127,5 @@ RSpec.configure do |config| config.include Shoulda::Matchers::ActiveModel, type: :model config.include Devise::Test::ControllerHelpers, type: :controller config.include Devise::Test::ControllerHelpers, type: :view + config.include Devise::Test::IntegrationHelpers, type: :system end diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index 40eea57e5..10ed09c19 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -3,9 +3,6 @@ require 'capybara-screenshot/rspec' require 'capybara/email/rspec' require 'selenium/webdriver' -Capybara.javascript_driver = :headless_chrome -Capybara.ignore_hidden_elements = false - Capybara.register_driver :chrome do |app| Capybara::Selenium::Driver.new(app, browser: :chrome) end @@ -34,11 +31,10 @@ Capybara.register_driver :headless_chrome do |app| end end -# FIXME: remove this line when https://github.com/rspec/rspec-rails/issues/1897 has been fixed -Capybara.server = :puma, { Silent: true } - Capybara.default_max_wait_time = 2 +Capybara.ignore_hidden_elements = false + # Save a snapshot of the HTML page when an integration test fails Capybara::Screenshot.autosave_on_failure = true # Keep only the screenshots generated from the last failing test suite @@ -49,13 +45,21 @@ Capybara::Screenshot.register_driver :headless_chrome do |driver, path| end RSpec.configure do |config| - # Set the user preferred language before Javascript feature specs. + config.before(:each, type: :system) do + driven_by :rack_test + end + + config.before(:each, type: :system, js: true) do + driven_by :headless_chrome + end + + # Set the user preferred language before Javascript system specs. # - # Features specs without Javascript run in a Rack stack, and respect the Accept-Language value. + # System specs without Javascript run in a Rack stack, and respect the Accept-Language value. # However specs using Javascript are run into a Headless Chrome, which doesn't support setting # the default Accept-Language value reliably. # So instead we set the locale cookie explicitly before each Javascript test. - config.before(:each, js: true) do + config.before(:each, type: :system, js: true) do visit '/' # Webdriver needs visiting a page before setting the cookie Capybara.current_session.driver.browser.manage.add_cookie( name: :locale, diff --git a/spec/support/database_cleaner.rb b/spec/support/database_cleaner.rb deleted file mode 100644 index 553e7ce34..000000000 --- a/spec/support/database_cleaner.rb +++ /dev/null @@ -1,23 +0,0 @@ -RSpec.configure do |config| - expect_list = [] - - config.before(:suite) do - DatabaseCleaner.clean_with(:truncation, except: expect_list) - end - - config.before(:each) do - DatabaseCleaner.strategy = :transaction - end - - config.before(:each, js: true) do - DatabaseCleaner.strategy = :deletion, { except: expect_list } - end - - config.before(:each) do - DatabaseCleaner.start - end - - config.after(:each) do - DatabaseCleaner.clean - end -end diff --git a/spec/support/feature_helpers.rb b/spec/support/system_helpers.rb similarity index 98% rename from spec/support/feature_helpers.rb rename to spec/support/system_helpers.rb index 371a906e8..3cda3ddb2 100644 --- a/spec/support/feature_helpers.rb +++ b/spec/support/system_helpers.rb @@ -1,4 +1,4 @@ -module FeatureHelpers +module SystemHelpers include ActiveJob::TestHelper def login_admin @@ -177,5 +177,5 @@ module FeatureHelpers end RSpec.configure do |config| - config.include FeatureHelpers, type: :feature + config.include SystemHelpers, type: :system end diff --git a/spec/features/accessibilite/wcag_usager_spec.rb b/spec/system/accessibilite/wcag_usager_spec.rb similarity index 98% rename from spec/features/accessibilite/wcag_usager_spec.rb rename to spec/system/accessibilite/wcag_usager_spec.rb index a6a716129..5ac9658aa 100644 --- a/spec/features/accessibilite/wcag_usager_spec.rb +++ b/spec/system/accessibilite/wcag_usager_spec.rb @@ -1,4 +1,4 @@ -feature 'wcag rules for usager', js: true do +describe 'wcag rules for usager', js: true do let(:procedure) { create(:procedure, :with_type_de_champ, :with_all_champs, :with_service, :for_individual, :published) } let(:password) { 'a very complicated password' } let(:litteraire_user) { create(:user, password: password) } diff --git a/spec/features/admin/admin_creation_spec.rb b/spec/system/admin/admin_creation_spec.rb similarity index 96% rename from spec/features/admin/admin_creation_spec.rb rename to spec/system/admin/admin_creation_spec.rb index 938bd1c56..f3786f7e8 100644 --- a/spec/features/admin/admin_creation_spec.rb +++ b/spec/system/admin/admin_creation_spec.rb @@ -1,4 +1,4 @@ -feature 'As an administrateur', js: true do +describe 'As an administrateur', js: true do let(:super_admin) { create(:super_admin) } let(:admin_email) { 'new_admin@gouv.fr' } let(:new_admin) { Administrateur.by_email(admin_email) } diff --git a/spec/features/admin/procedure_cloning_spec.rb b/spec/system/admin/procedure_cloning_spec.rb similarity index 92% rename from spec/features/admin/procedure_cloning_spec.rb rename to spec/system/admin/procedure_cloning_spec.rb index 9a7019d55..bd4535ecc 100644 --- a/spec/features/admin/procedure_cloning_spec.rb +++ b/spec/system/admin/procedure_cloning_spec.rb @@ -1,6 +1,6 @@ -require 'features/admin/procedure_spec_helper' +require 'system/admin/procedure_spec_helper' -feature 'As an administrateur I wanna clone a procedure', js: true do +describe 'As an administrateur I wanna clone a procedure', js: true do include ProcedureSpecHelper let(:administrateur) { create(:administrateur) } diff --git a/spec/features/admin/procedure_creation_spec.rb b/spec/system/admin/procedure_creation_spec.rb similarity index 96% rename from spec/features/admin/procedure_creation_spec.rb rename to spec/system/admin/procedure_creation_spec.rb index 8208246f2..09025a0ba 100644 --- a/spec/features/admin/procedure_creation_spec.rb +++ b/spec/system/admin/procedure_creation_spec.rb @@ -1,6 +1,6 @@ -require 'features/admin/procedure_spec_helper' +require 'system/admin/procedure_spec_helper' -feature 'As an administrateur I wanna create a new procedure', js: true do +describe 'As an administrateur I wanna create a new procedure', js: true do include ProcedureSpecHelper let(:administrateur) { create(:administrateur, :with_procedure) } diff --git a/spec/features/admin/procedure_locked_spec.rb b/spec/system/admin/procedure_locked_spec.rb similarity index 96% rename from spec/features/admin/procedure_locked_spec.rb rename to spec/system/admin/procedure_locked_spec.rb index 1e18c114d..58da6c7a8 100644 --- a/spec/features/admin/procedure_locked_spec.rb +++ b/spec/system/admin/procedure_locked_spec.rb @@ -1,4 +1,4 @@ -feature 'procedure locked' do +describe 'procedure locked' do let(:administrateur) { create(:administrateur) } before do diff --git a/spec/features/admin/procedure_publish_spec.rb b/spec/system/admin/procedure_publish_spec.rb similarity index 96% rename from spec/features/admin/procedure_publish_spec.rb rename to spec/system/admin/procedure_publish_spec.rb index f7df44200..f60d5aed4 100644 --- a/spec/features/admin/procedure_publish_spec.rb +++ b/spec/system/admin/procedure_publish_spec.rb @@ -1,6 +1,6 @@ -require 'features/admin/procedure_spec_helper' +require 'system/admin/procedure_spec_helper' -feature 'Publication de démarches', js: true do +describe 'Publication de démarches', js: true do include ProcedureSpecHelper let(:administrateur) { create(:administrateur) } diff --git a/spec/features/admin/procedure_spec_helper.rb b/spec/system/admin/procedure_spec_helper.rb similarity index 100% rename from spec/features/admin/procedure_spec_helper.rb rename to spec/system/admin/procedure_spec_helper.rb diff --git a/spec/features/admin/procedure_update_spec.rb b/spec/system/admin/procedure_update_spec.rb similarity index 95% rename from spec/features/admin/procedure_update_spec.rb rename to spec/system/admin/procedure_update_spec.rb index 0e13b5646..adcf50507 100644 --- a/spec/features/admin/procedure_update_spec.rb +++ b/spec/system/admin/procedure_update_spec.rb @@ -1,6 +1,6 @@ -require 'features/admin/procedure_spec_helper' +require 'system/admin/procedure_spec_helper' -feature 'Administrateurs can edit procedures', js: true do +describe 'Administrateurs can edit procedures', js: true do include ProcedureSpecHelper let(:administrateur) { create(:administrateur) } diff --git a/spec/features/api_particulier/api_particulier_spec.rb b/spec/system/api_particulier/api_particulier_spec.rb similarity index 99% rename from spec/features/api_particulier/api_particulier_spec.rb rename to spec/system/api_particulier/api_particulier_spec.rb index de793f453..ce398eca2 100644 --- a/spec/features/api_particulier/api_particulier_spec.rb +++ b/spec/system/api_particulier/api_particulier_spec.rb @@ -1,4 +1,4 @@ -feature 'fetch API Particulier Data', js: true do +describe 'fetch API Particulier Data', js: true do let(:administrateur) { create(:administrateur) } let(:expected_token) { 'd7e9c9f4c3ca00caadde31f50fd4521a' } diff --git a/spec/features/experts/expert_spec.rb b/spec/system/experts/expert_spec.rb similarity index 99% rename from spec/features/experts/expert_spec.rb rename to spec/system/experts/expert_spec.rb index 06eaa6126..92837c9d8 100644 --- a/spec/features/experts/expert_spec.rb +++ b/spec/system/experts/expert_spec.rb @@ -1,4 +1,4 @@ -feature 'Inviting an expert:' do +describe 'Inviting an expert:' do include ActiveJob::TestHelper include ActionView::Helpers diff --git a/spec/features/forgery_spec.rb b/spec/system/forgery_spec.rb similarity index 93% rename from spec/features/forgery_spec.rb rename to spec/system/forgery_spec.rb index e094fa9a4..93cffbf5f 100644 --- a/spec/features/forgery_spec.rb +++ b/spec/system/forgery_spec.rb @@ -1,4 +1,4 @@ -feature 'Protecting against request forgeries:', :allow_forgery_protection, :show_exception_pages do +describe 'Protecting against request forgeries:', :allow_forgery_protection, :show_exception_pages do let(:user) { create(:user, password: password) } let(:password) { 'ThisIsTheUserPassword' } diff --git a/spec/features/france_connect/france_connect_particulier_spec.rb b/spec/system/france_connect/france_connect_particulier_spec.rb similarity index 98% rename from spec/features/france_connect/france_connect_particulier_spec.rb rename to spec/system/france_connect/france_connect_particulier_spec.rb index 4498f8031..a0a8b8e01 100644 --- a/spec/features/france_connect/france_connect_particulier_spec.rb +++ b/spec/system/france_connect/france_connect_particulier_spec.rb @@ -1,4 +1,4 @@ -feature 'France Connect Particulier Connexion' do +describe 'France Connect Particulier Connexion' do let(:code) { 'plop' } let(:given_name) { 'titi' } let(:family_name) { 'toto' } diff --git a/spec/features/help_spec.rb b/spec/system/help_spec.rb similarity index 98% rename from spec/features/help_spec.rb rename to spec/system/help_spec.rb index 4aa7de431..c338837de 100644 --- a/spec/features/help_spec.rb +++ b/spec/system/help_spec.rb @@ -1,4 +1,4 @@ -feature 'Getting help:' do +describe 'Getting help:' do scenario 'a Help button is visible on public pages' do visit '/' within('.new-header') do diff --git a/spec/features/i18n_spec.rb b/spec/system/i18n_spec.rb similarity index 90% rename from spec/features/i18n_spec.rb rename to spec/system/i18n_spec.rb index 0c372a0cd..681e6a32f 100644 --- a/spec/features/i18n_spec.rb +++ b/spec/system/i18n_spec.rb @@ -1,4 +1,4 @@ -feature 'Accessing the website in different languages:' do +describe 'Accessing the website in different languages:' do context 'when the i18n feature-flag is enabled' do before { ENV['LOCALIZATION_ENABLED'] = 'true' } after { ENV['LOCALIZATION_ENABLED'] = 'false' } diff --git a/spec/features/instructeurs/expert_spec.rb b/spec/system/instructeurs/expert_spec.rb similarity index 98% rename from spec/features/instructeurs/expert_spec.rb rename to spec/system/instructeurs/expert_spec.rb index 84b3d56a6..4923b5142 100644 --- a/spec/features/instructeurs/expert_spec.rb +++ b/spec/system/instructeurs/expert_spec.rb @@ -1,4 +1,4 @@ -feature 'Inviting an expert:', js: true do +describe 'Inviting an expert:', js: true do include ActiveJob::TestHelper include ActionView::Helpers diff --git a/spec/features/instructeurs/instructeur_creation_spec.rb b/spec/system/instructeurs/instructeur_creation_spec.rb similarity index 95% rename from spec/features/instructeurs/instructeur_creation_spec.rb rename to spec/system/instructeurs/instructeur_creation_spec.rb index 978b068c3..400417e28 100644 --- a/spec/features/instructeurs/instructeur_creation_spec.rb +++ b/spec/system/instructeurs/instructeur_creation_spec.rb @@ -1,4 +1,4 @@ -feature 'As an instructeur', js: true do +describe 'As an instructeur', js: true do let(:administrateur) { create(:administrateur, :with_procedure) } let(:procedure) { administrateur.procedures.first } let(:instructeur_email) { 'new_instructeur@gouv.fr' } diff --git a/spec/features/instructeurs/instruction_spec.rb b/spec/system/instructeurs/instruction_spec.rb similarity index 99% rename from spec/features/instructeurs/instruction_spec.rb rename to spec/system/instructeurs/instruction_spec.rb index eca6e1773..818a2cf8b 100644 --- a/spec/features/instructeurs/instruction_spec.rb +++ b/spec/system/instructeurs/instruction_spec.rb @@ -1,4 +1,4 @@ -feature 'Instructing a dossier:', js: true do +describe 'Instructing a dossier:', js: true do include ActiveJob::TestHelper let(:password) { 'my-s3cure-p4ssword' } diff --git a/spec/features/instructeurs/procedure_filters_spec.rb b/spec/system/instructeurs/procedure_filters_spec.rb similarity index 99% rename from spec/features/instructeurs/procedure_filters_spec.rb rename to spec/system/instructeurs/procedure_filters_spec.rb index 342151059..fee58f35a 100644 --- a/spec/features/instructeurs/procedure_filters_spec.rb +++ b/spec/system/instructeurs/procedure_filters_spec.rb @@ -1,4 +1,4 @@ -feature "procedure filters" do +describe "procedure filters" do let(:instructeur) { create(:instructeur) } let(:procedure) { create(:procedure, :published, :with_type_de_champ, instructeurs: [instructeur]) } let!(:type_de_champ) { procedure.types_de_champ.first } diff --git a/spec/features/new_administrateur/types_de_champ_spec.rb b/spec/system/new_administrateur/types_de_champ_spec.rb similarity index 98% rename from spec/features/new_administrateur/types_de_champ_spec.rb rename to spec/system/new_administrateur/types_de_champ_spec.rb index ed9878c9a..18fa17229 100644 --- a/spec/features/new_administrateur/types_de_champ_spec.rb +++ b/spec/system/new_administrateur/types_de_champ_spec.rb @@ -1,4 +1,4 @@ -feature 'As an administrateur I can edit types de champ', js: true do +describe 'As an administrateur I can edit types de champ', js: true do let(:administrateur) { procedure.administrateurs.first } let(:procedure) { create(:procedure) } diff --git a/spec/features/outdated_browser_spec.rb b/spec/system/outdated_browser_spec.rb similarity index 97% rename from spec/features/outdated_browser_spec.rb rename to spec/system/outdated_browser_spec.rb index 0d8b5d104..a632b951f 100644 --- a/spec/features/outdated_browser_spec.rb +++ b/spec/system/outdated_browser_spec.rb @@ -1,4 +1,4 @@ -feature 'Outdated browsers support:' do +describe 'Outdated browsers support:' do context 'when the user browser is outdated' do before(:each) do ie_10_user_agent = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0; .NET4.0E; .NET4.0C; InfoPath.3)' diff --git a/spec/features/routing/full_scenario_spec.rb b/spec/system/routing/full_scenario_spec.rb similarity index 99% rename from spec/features/routing/full_scenario_spec.rb rename to spec/system/routing/full_scenario_spec.rb index 47cdee2d5..cc5bb2837 100644 --- a/spec/features/routing/full_scenario_spec.rb +++ b/spec/system/routing/full_scenario_spec.rb @@ -1,4 +1,4 @@ -feature 'The routing', js: true do +describe 'The routing', js: true do let(:password) { 'a very complicated password' } let(:procedure) { create(:procedure, :with_type_de_champ, :with_service, :for_individual) } let(:administrateur) { create(:administrateur, procedures: [procedure]) } diff --git a/spec/features/sessions/sign_in_spec.rb b/spec/system/sessions/sign_in_spec.rb similarity index 98% rename from spec/features/sessions/sign_in_spec.rb rename to spec/system/sessions/sign_in_spec.rb index b734463c0..bc68e01f6 100644 --- a/spec/features/sessions/sign_in_spec.rb +++ b/spec/system/sessions/sign_in_spec.rb @@ -1,4 +1,4 @@ -feature 'Signin in:' do +describe 'Signin in:' do let!(:user) { create(:user, password: password) } let(:password) { 'my-s3cure-p4ssword' } diff --git a/spec/features/users/brouillon_spec.rb b/spec/system/users/brouillon_spec.rb similarity index 99% rename from spec/features/users/brouillon_spec.rb rename to spec/system/users/brouillon_spec.rb index 8abfe3ccd..16cf8156d 100644 --- a/spec/features/users/brouillon_spec.rb +++ b/spec/system/users/brouillon_spec.rb @@ -1,4 +1,4 @@ -feature 'The user' do +describe 'The user' do let(:password) { 'my-s3cure-p4ssword' } let!(:user) { create(:user, password: password) } diff --git a/spec/features/users/change_email_spec.rb b/spec/system/users/change_email_spec.rb similarity index 96% rename from spec/features/users/change_email_spec.rb rename to spec/system/users/change_email_spec.rb index 016f3ee90..c2a8bfcf0 100644 --- a/spec/features/users/change_email_spec.rb +++ b/spec/system/users/change_email_spec.rb @@ -1,4 +1,4 @@ -feature 'Changing an email' do +describe 'Changing an email' do let(:old_email) { 'old@email.com' } let(:user) { create(:user, email: old_email) } diff --git a/spec/features/users/dossier_creation_spec.rb b/spec/system/users/dossier_creation_spec.rb similarity index 99% rename from spec/features/users/dossier_creation_spec.rb rename to spec/system/users/dossier_creation_spec.rb index 99e075a0a..130cabaca 100644 --- a/spec/features/users/dossier_creation_spec.rb +++ b/spec/system/users/dossier_creation_spec.rb @@ -1,4 +1,4 @@ -feature 'Creating a new dossier:' do +describe 'Creating a new dossier:' do let(:user) { create(:user) } let(:siret) { '41816609600051' } let(:siren) { siret[0...9] } diff --git a/spec/features/users/dossier_details_spec.rb b/spec/system/users/dossier_details_spec.rb similarity index 97% rename from spec/features/users/dossier_details_spec.rb rename to spec/system/users/dossier_details_spec.rb index 2f37ce02c..741626461 100644 --- a/spec/features/users/dossier_details_spec.rb +++ b/spec/system/users/dossier_details_spec.rb @@ -1,4 +1,4 @@ -require 'features/users/dossier_shared_examples.rb' +require 'system/users/dossier_shared_examples.rb' describe 'Dossier details:' do let(:user) { create(:user) } diff --git a/spec/features/users/dossier_shared_examples.rb b/spec/system/users/dossier_shared_examples.rb similarity index 100% rename from spec/features/users/dossier_shared_examples.rb rename to spec/system/users/dossier_shared_examples.rb diff --git a/spec/features/users/invite_spec.rb b/spec/system/users/invite_spec.rb similarity index 98% rename from spec/features/users/invite_spec.rb rename to spec/system/users/invite_spec.rb index 117b9f68b..9ece00f57 100644 --- a/spec/features/users/invite_spec.rb +++ b/spec/system/users/invite_spec.rb @@ -1,6 +1,6 @@ -require 'features/users/dossier_shared_examples.rb' +require 'system/users/dossier_shared_examples.rb' -feature 'Invitations' do +describe 'Invitations' do let(:owner) { create(:user) } let(:invited_user) { create(:user, email: 'user_invite@exemple.fr') } let(:procedure) { create(:simple_procedure) } diff --git a/spec/features/users/linked_dropdown_spec.rb b/spec/system/users/linked_dropdown_spec.rb similarity index 98% rename from spec/features/users/linked_dropdown_spec.rb rename to spec/system/users/linked_dropdown_spec.rb index bc809d901..c4bf21a92 100644 --- a/spec/features/users/linked_dropdown_spec.rb +++ b/spec/system/users/linked_dropdown_spec.rb @@ -1,4 +1,4 @@ -feature 'linked dropdown lists' do +describe 'linked dropdown lists' do let(:password) { 'my-s3cure-p4ssword' } let!(:user) { create(:user, password: password) } diff --git a/spec/features/users/list_dossiers_spec.rb b/spec/system/users/list_dossiers_spec.rb similarity index 100% rename from spec/features/users/list_dossiers_spec.rb rename to spec/system/users/list_dossiers_spec.rb diff --git a/spec/features/users/managing_password_spec.rb b/spec/system/users/managing_password_spec.rb similarity index 99% rename from spec/features/users/managing_password_spec.rb rename to spec/system/users/managing_password_spec.rb index 7ef69b716..cee681c7f 100644 --- a/spec/features/users/managing_password_spec.rb +++ b/spec/system/users/managing_password_spec.rb @@ -1,4 +1,4 @@ -feature 'Managing password:' do +describe 'Managing password:' do context 'for simple users' do let(:user) { create(:user) } let(:new_password) { 'a simple password' } diff --git a/spec/features/users/sign_out_spec.rb b/spec/system/users/sign_out_spec.rb similarity index 92% rename from spec/features/users/sign_out_spec.rb rename to spec/system/users/sign_out_spec.rb index 85516afcb..9bed3514d 100644 --- a/spec/features/users/sign_out_spec.rb +++ b/spec/system/users/sign_out_spec.rb @@ -1,4 +1,4 @@ -feature 'Sign out' do +describe 'Sign out' do context 'when a user is logged in' do let(:user) { create(:administrateur).user } diff --git a/spec/features/users/sign_up_spec.rb b/spec/system/users/sign_up_spec.rb similarity index 99% rename from spec/features/users/sign_up_spec.rb rename to spec/system/users/sign_up_spec.rb index 3129120ae..429a9dc2f 100644 --- a/spec/features/users/sign_up_spec.rb +++ b/spec/system/users/sign_up_spec.rb @@ -1,4 +1,4 @@ -feature 'Signing up:' do +describe 'Signing up:' do let(:user_email) { generate :user_email } let(:user_password) { 'my-s3cure-p4ssword' } let(:procedure) { create :simple_procedure, :with_service } diff --git a/spec/features/users/transfer_dossier_spec.rb b/spec/system/users/transfer_dossier_spec.rb similarity index 100% rename from spec/features/users/transfer_dossier_spec.rb rename to spec/system/users/transfer_dossier_spec.rb