Commit graph

65 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
clemkeirua
48d2093577 tag 'groupe instructeur' uniquement si la procedure est routee 2020-02-20 14:48:14 +00:00
clemkeirua
059d80ea34 #4785 ajout d'une balise 'groupe instructeur' 2020-02-20 14:48:14 +00:00
clemkeirua
57a0973c99 added a test to show #4658 does not exist 2020-02-03 15:43:53 +01:00
Pierre de La Morinerie
5fc88eb6a2 specs: fix a flaky repetitions test
The test would sometime fail when the two fields are created in a
different order than expected.
2019-10-24 16:52:29 +02:00
Paul Chavard
b97cbd3402 Serialize champ repetition for tags
closes #4272
2019-09-12 17:23:18 +02:00
Paul Chavard
3b8d3b7967 Add Style/CollectionMethods to rubocop 2019-09-12 14:48:18 +02:00
clemkeirua
7eeddc0b79 using a shared example + scoped to state TERMINE 2019-07-17 11:53:16 +02:00
clemkeirua
b8fa567c81 ajout du tag 'lien document justificatif' 2019-07-17 11:53:16 +02:00
Mathieu Magnin
10d3ba10f2 Before save copy body in rich_body 2019-07-03 13:15:49 +02:00
simon lehericey
ee296f2b44 Use default format for date and datetime champ 2019-06-12 17:48:12 +02:00
clemkeirua
d0794f42d1 fix tag_substitution_concern links for lien attestation 2019-05-07 08:54:29 +02:00
clemkeirua
c98655be52 ellipsis on file input overflow 2019-05-07 08:54:29 +02:00
clemkeirua
0e26bda186 cleanup the tag substitution concern & uniformization 2019-05-07 08:54:29 +02:00
clemkeirua
e4259466b4 nettoyage du tag_substitution_concern 2019-05-07 08:54:29 +02:00
clemkeirua
f8a2598647 ajout du lien vers le justificatif dans la balise --lien attestation-- 2019-05-07 08:54:29 +02:00
clemkeirua
747dc505cc ajout d'un test 2019-05-07 08:54:29 +02:00
Frederic Merizen
b428406fc7 [Fix #3578] No tags for champs that cannot have user input anyway 2019-03-11 10:26:27 +01:00
Frederic Merizen
1d0156f9c6 [#3572] Add tests 2019-03-08 18:32:35 +01:00
clemkeirua
71bff0812c ajout d'un test pour caractériser le cas service = null 2019-02-21 12:34:53 +01:00
clemkeirua
236f73f838 ajout d'une balise pour le nom du service 2019-02-21 12:18:44 +01:00
Frederic Merizen
a255e61556 [#3356] Improve formatting for menus that only have a primary value 2019-02-05 17:35:30 +01:00
Frederic Merizen
a3d7c8de55 [Fix #3356] Add tags for primary menu only / secondary menu only 2019-02-05 17:35:30 +01:00
gregoirenovel
5fa5f2aa37 Bump development gems
- rubocop (0.61.1 → 0.62.0)
2019-01-05 11:47:55 +01:00
simon lehericey
e684cec516 DateTime.new => Time.zone.local 2018-10-26 10:10:20 +00:00
simon lehericey
2238e5bd9f Time.now => Time.zone.now 2018-10-26 10:10:20 +00:00
Pierre de La Morinerie
0526551e71 templates: update link to dossier 2018-09-27 17:22:59 +02:00
gregoirenovel
0c9628c180 Fix some files according the the .editorconfig rules 2018-09-20 16:23:09 +02:00
gregoirenovel
a87e79ac1f Update a test to comply with Rubocop rules 2018-09-20 16:23:09 +02:00
gregoirenovel
00ecae5f93 Procédure → Démarche 2018-09-05 15:46:24 +02:00
gregoirenovel
4b071ecf06 Use enum to the fullest with Dossier.states 2018-08-29 17:31:08 +02:00
gregoirenovel
2d3b553e4d Use enum to the fullest with TypeDeChamp.type_champs 2018-08-29 17:31:08 +02:00
Paul Chavard
753a81c2d3 Update tag substitution concern 2018-05-24 17:54:51 +02:00
Frederic Merizen
84c864ed11 [#1563] Add lien attestation link to closed mail template 2018-04-04 09:34:04 +02:00
Paul Chavard
9cc6d494a4 Spec STI loading champ/type de champ 2018-03-29 17:45:19 +02:00
Frederic Merizen
13d251d970 describe '#method' rather than describe '.method' for instance methods 2018-03-20 16:00:30 +01:00
Mathieu Magnin
b7de632d6c [Fix #1479] Create a sanitize email concern 2018-03-14 17:41:45 +01:00
gregoirenovel
e26f4148ff Bump development gems
- brakeman
- rubocop
- scss_lint
2018-03-06 16:17:22 +01:00
gregoirenovel
fe7f8da636 Revert "Bump development gems"
This reverts commit d6ad3fc3fd.
2018-03-06 15:11:26 +01:00
gregoirenovel
d6ad3fc3fd Bump development gems
- brakeman
- rubocop
- scss_lint
2018-03-06 10:36:35 +01:00
gregoirenovel
1b8b6a3274 TPS -> demarches-simplifiees.fr 2018-02-28 18:14:06 +01:00
Paul Chavard
0c1d529b61 Unify :type_de_champ public/private factories 2018-02-14 11:49:06 +01:00
Mathieu Magnin
dcb38d79a3 [Fix #1309] Datetime value should be print with yyyy-mm-dd format 2018-01-30 13:49:16 +01:00
Frederic Merizen
9b4ce1517c Use lambda instead of send for etablissement tag 2018-01-18 18:35:07 +01:00
Frederic Merizen
8f41ab89cf [#1203] Do not include champs privés in accusé de réception 2018-01-18 18:26:14 +01:00
Frederic Merizen
eebab14954 [Fix #1203] No début d’instruction tag in accusé de réception mails
Doesn’t make sense functionnally
2018-01-18 18:26:14 +01:00
Frederic Merizen
9f7ffddb31 [#1203] Allow filtering tags based on an arbitray status 2018-01-18 18:26:14 +01:00
Frederic Merizen
1282fc2113 [#1203] Use factory girl to instanciate model in spec 2018-01-18 18:26:14 +01:00
gregoirenovel
897a30da0c Enable the Layout/SpaceInsideBlockBraces cop 2018-01-18 10:53:34 +01:00
gregoirenovel
1e71188d4d Enable the Layout/IndentationConsistency cop 2018-01-15 22:33:13 +01:00