diff options
author | Marcel Amirault <ravlen@gmail.com> | 2019-02-12 15:39:48 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2019-02-12 15:39:48 +0300 |
commit | 9d6a8003e07ad621206387c641343e020aeac188 (patch) | |
tree | 48ede72825b998a6848531c35747b9744a64932d /doc/development/ee_features.md | |
parent | 8d7ed982ef361120fef3b431249684333a5462c3 (diff) |
Docs: Realign more CE docs that diverged from EE unnecessarily (second MR)
Diffstat (limited to 'doc/development/ee_features.md')
-rw-r--r-- | doc/development/ee_features.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/development/ee_features.md b/doc/development/ee_features.md index e0985922443..3e85c0e1995 100644 --- a/doc/development/ee_features.md +++ b/doc/development/ee_features.md @@ -831,6 +831,29 @@ should remain working as-is when EE is running without a license. Instead place EE specs in the `ee/spec` folder. +### Code in `spec/factories` + +Use `FactoryBot.modify` to extend factories already defined in CE. + +Note that you cannot define new factories (even nested ones) inside the `FactoryBot.modify` block. You can do so in a +separate `FactoryBot.define` block as shown in the example below: + +```ruby +# ee/spec/factories/notes.rb +FactoryBot.modify do + factory :note do + trait :on_epic do + noteable { create(:epic) } + project nil + end + end +end + +FactoryBot.define do + factory :note_on_epic, parent: :note, traits: [:on_epic] +end +``` + ## JavaScript code in `assets/javascripts/` To separate EE-specific JS-files we should also move the files into an `ee` folder. |