diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-12-15 21:25:23 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-12-15 21:25:23 +0000 |
commit | 223cb3788a744f9b1b92959d3337000358db108b (patch) | |
tree | 77858e7ec0e2a731ddb7791f99d75ef4c23b4b54 /doc/development/testing_guide | |
parent | b3606cff38b9defc764706ed6529a9e27dcf4847 (diff) | |
parent | a1a323392d4f0cb59eab2e215fa4010b84fc122d (diff) | |
download | gitlab-ce-41117-empty-state.tar.gz |
Merge branch 'master' into 41117-empty-state41117-empty-state
* master: (71 commits)
Update CHANGELOG.md for 10.2.5
Change CI config to use new base image
fix issue #39843 Incorrect guidance stating blocked users will be removed from groups and projects as members
Add changelog entry
Update tests for toggle design change
Update toggle styles to use icons
Use icons instead of string labels for toggles
Fix Rubocop offense in QA project specs
Add SAST docs
Fix UX issues in system info page
Update svg package version
Make sure user email is read only when synced with LDAP
Add note about automatic pipelines when enabling Auto DevOps
Backport changes from EE
Docs update documentation guidelines
Don't use Markdown cache for stubbed settings in specs
Fix remaining calls to GitLab QA factories
Rename QA scenarios to make factory concept explicit
Export JS classes as modules
Make rubocop happy
...
Diffstat (limited to 'doc/development/testing_guide')
-rw-r--r-- | doc/development/testing_guide/best_practices.md | 14 | ||||
-rw-r--r-- | doc/development/testing_guide/index.md | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md index 8b7b015427f..edb8f372ea3 100644 --- a/doc/development/testing_guide/best_practices.md +++ b/doc/development/testing_guide/best_practices.md @@ -8,8 +8,8 @@ and effective _as well as_ fast. Here are some things to keep in mind regarding test performance: -- `double` and `spy` are faster than `FactoryGirl.build(...)` -- `FactoryGirl.build(...)` and `.build_stubbed` are faster than `.create`. +- `double` and `spy` are faster than `FactoryBot.build(...)` +- `FactoryBot.build(...)` and `.build_stubbed` are faster than `.create`. - Don't `create` an object when `build`, `build_stubbed`, `attributes_for`, `spy`, or `double` will do. Database persistence is slow! - Don't mark a feature as requiring JavaScript (through `@javascript` in @@ -254,13 +254,13 @@ end ### Factories -GitLab uses [factory_girl] as a test fixture replacement. +GitLab uses [factory_bot] as a test fixture replacement. - Factory definitions live in `spec/factories/`, named using the pluralization of their corresponding model (`User` factories are defined in `users.rb`). - There should be only one top-level factory definition per file. -- FactoryGirl methods are mixed in to all RSpec groups. This means you can (and - should) call `create(...)` instead of `FactoryGirl.create(...)`. +- FactoryBot methods are mixed in to all RSpec groups. This means you can (and + should) call `create(...)` instead of `FactoryBot.create(...)`. - Make use of [traits] to clean up definitions and usages. - When defining a factory, don't define attributes that are not required for the resulting record to pass validation. @@ -269,8 +269,8 @@ GitLab uses [factory_girl] as a test fixture replacement. - Factories don't have to be limited to `ActiveRecord` objects. [See example](https://gitlab.com/gitlab-org/gitlab-ce/commit/0b8cefd3b2385a21cfed779bd659978c0402766d). -[factory_girl]: https://github.com/thoughtbot/factory_girl -[traits]: http://www.rubydoc.info/gems/factory_girl/file/GETTING_STARTED.md#Traits +[factory_bot]: https://github.com/thoughtbot/factory_bot +[traits]: http://www.rubydoc.info/gems/factory_bot/file/GETTING_STARTED.md#Traits ### Fixtures diff --git a/doc/development/testing_guide/index.md b/doc/development/testing_guide/index.md index 8045bbad7ba..65386f231a0 100644 --- a/doc/development/testing_guide/index.md +++ b/doc/development/testing_guide/index.md @@ -33,7 +33,7 @@ changes should be tested. ## [Testing best practices](best_practices.md) -Everything you should know about how to write good tests: RSpec, FactoryGirl, +Everything you should know about how to write good tests: RSpec, FactoryBot, system tests, parameterized tests etc. --- |