Commit graph

20 commits

Author SHA1 Message Date
Pierre de La Morinerie
4cb747fdb6 specs: always require rails_helper
Test helpers are separated between two files: spec_helper and
rails_helper. This separation is meant to allow tests that do not
require Rails (like testing standalone libs) to boot faster.

The spec_helper file is always loaded, through `--require spec_helper`
in the `.rspec` config file. When needed, the rails_helper file is
expected to be required manually.

This is fine, but:
- Many test files have a redundant `require 'spec_helper'` line;
- Many test files should require `rails_helper`, but don't.

Not requiring `rails_helper` will cause the Rails-concerned section of
the test environment not to be configured–which may cause subtle bugs
(like the test database not being properly initialized).

Moreover, Spring loads all the Rails files on preloading anyway. So the
gains from using only `spec_helper` are thin.

To streamline this process, this commit:
- Configures `.rspec` to require `rails_helper` by default;
- Remove all manual requires to spec_helper or rails_helper.

Reference: https://stackoverflow.com/questions/24145329/how-is-spec-rails-helper-rb-different-from-spec-spec-helper-rb-do-i-need-it
2020-03-31 12:48:32 +02:00
maatinito
9672d892e9 Bug with time zone: Time.zone.today looses time_zone and may breaks database comparisons 2019-12-11 17:34:10 +01:00
Paul Chavard
7b947feae4 Rename demarche archivée to demarche close 2019-11-28 15:07:16 +01:00
maatinito
14bc2b99b9 auto-archive badly occurs in UTC time and not in local time (1 hour too late in France, 10 hours before in Tahiti ;-) 2019-11-25 14:39:42 +01:00
simon lehericey
3fde2a6f70 Rename gestionnaire in code to instructeur 2019-08-12 13:47:01 +02:00
Paul Chavard
dba8d65137 Track dossier operations with author and subject 2019-05-14 14:31:03 +02:00
simon lehericey
99bfd19b41 [fix #3268] Jobs: use automatic_operation 2019-01-16 17:20:12 +01:00
Paul Chavard
98d388b64d Use state change methods on dossier in dossier auto archive job 2018-11-27 12:49:40 +01:00
gregoirenovel
4b071ecf06 Use enum to the fullest with Dossier.states 2018-08-29 17:31:08 +02:00
Paul Chavard
7070b0aba0 Fix tests to rely on aasm states 2018-05-23 16:31:27 +02:00
gregoirenovel
b5b73c8639 Enable all the Security cops 2018-03-06 17:18:44 +01:00
gregoirenovel
d30ea70c08 Enable the Layout/SpaceInsideParens cop 2018-01-18 10:53:35 +01:00
gregoirenovel
897a30da0c Enable the Layout/SpaceInsideBlockBraces cop 2018-01-18 10:53:34 +01:00
Simon Lehericey
c83552f423 [fix #504] Dossier: without_continuation -> sans_suite 2017-12-15 12:10:54 +01:00
Simon Lehericey
2be9b8d2ba [fix #504] Dossier: refused -> refuse 2017-12-15 12:10:54 +01:00
Simon Lehericey
a13256f73d [fix #504] Dossier: closed -> accepte 2017-12-15 12:10:54 +01:00
LeSim
3dda27b281 [fix #504] Dossier: received -> en_instruction 2017-12-15 12:10:54 +01:00
Simon Lehericey
72bae2c374 [fix #504] Dossier: draft -> brouillon 2017-12-15 11:52:09 +01:00
LeSim
56545933a9 [fix #504] Dossier: initiated -> en_construction
The change must not impact the api
2017-12-15 11:52:09 +01:00
gregoirenovel
51f57d983e Use ActiveJob 2017-10-05 15:42:48 +02:00
Renamed from spec/workers/auto_archive_procedure_worker_spec.rb (Browse further)