Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9be7f2e4
Commit
9be7f2e4
authored
Oct 06, 2020
by
Peter Leitzen
Committed by
Amy Qualls
Oct 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Mention `let_it_be` aliases in the testing guide docs
parent
d299aaee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
doc/development/testing_guide/best_practices.md
doc/development/testing_guide/best_practices.md
+9
-4
No files found.
doc/development/testing_guide/best_practices.md
View file @
9be7f2e4
...
...
@@ -484,17 +484,22 @@ This will result in only one `Project`, `User`, and `ProjectMember` created for
is handled automatically using a transaction rollback.
Note that if you modify an object defined inside a
`let_it_be`
block,
then you will need to reload the object as needed, or specify the
`reload`
option to reload for every example.
then you must do one of the following:
-
Reload the object as needed.
-
Use the
`let_it_be_with_reload`
alias.
-
Specify the
`reload`
option to reload for every example.
```
ruby
let_it_be_with_reload
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
```
You can also
specify the
`refind`
option as well to completely load a
new object.
You can also
use the
`let_it_be_with_refind`
alias, or specify the
`refind`
option as well to completely load a
new object.
```
ruby
let_it_be_with_refind
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
,
refind:
true
)
{
create
(
:project
)
}
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment