-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: remove champ factories #10569
Conversation
PR Summary
|
78f6ce8
to
6e75a4e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #10569 +/- ##
==========================================
- Coverage 80.45% 80.23% -0.23%
==========================================
Files 1235 1233 -2
Lines 26309 26263 -46
Branches 4725 4716 -9
==========================================
- Hits 21166 21071 -95
- Misses 5143 5192 +49 ☔ View full report in Codecov by Sentry. |
7076a17
to
0cfab44
Compare
bc039c4
to
a865082
Compare
2018a2a
to
9f945dd
Compare
84b731e
to
6a10a89
Compare
context 'when creating the model directly' do | ||
let(:champ_text_row_1) { create(:champ_text, type_de_champ: tdc_text, row_id: ULID.generate, parent: champ, dossier: nil) } | ||
|
||
it 'associates nested champs to the parent dossier' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l'impression que cette spec ne servait a rien si ce n'est de tester les factories
let(:data) { "data" } | ||
subject { champ.update_with_external_data!(data: data) } | ||
|
||
it { expect { subject }.to change { champ.reload.data }.to(data) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, on testait un update!(data:)
let(:champ_pj) { create (:champ_piece_justificative) } | ||
it { is_expected.to be_falsy } | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deadspec – il y avait un attribute skip_validation sur les champs, en 2020...
e9e1066
to
9d19ba6
Compare
# reload: it can be out of sync in test if some tdcs are added wihtout using add_tdc | ||
types_de_champ_public.reload.map(&:build_champ) | ||
types_de_champ_public.reload.map { _1.build_champ(dossier:) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
le reload ne serait-t'il pas de trop ? ou p-e le conditionné à l'env de test car il n'y a pas d'interet en prod
# reload: it can be out of sync in test if some tdcs are added wihtout using add_tdc | ||
types_de_champ_public.reload.map(&:build_champ) | ||
types_de_champ_public.reload.map { _1.build_champ(dossier:) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
types_de_champ_public.reload.map { _1.build_champ(dossier:) } | |
types_de_champ_public.reload if Rails.env.test? | |
types_de_champ_public.map { _1.build_champ(dossier:) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
j'ai un refactoring sur ce code qui arrive dans la prochaine PR. Je n'ai pas trop envie de creuser ça maintenant.
# reload: it can be out of sync in test if some tdcs are added wihtout using add_tdc | ||
types_de_champ_private.reload.map(&:build_champ) | ||
types_de_champ_private.reload.map { _1.build_champ(dossier:) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
types_de_champ_private.reload.map { _1.build_champ(dossier:) } | |
types_de_champ_private.reload if Rails.env.test? | |
types_de_champ_private.map { _1.build_champ(dossier:) } |
c2c4c2b
to
f9026b7
Compare
59c74b7
to
2b46f67
Compare
2b46f67
to
229483d
Compare
some failing specs