File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -66,30 +66,30 @@ guidelines:
66
66
67
67
1 . Be sure to clean up any data in an ` after(:context) ` hook:
68
68
69
- ``` ruby
70
- before(:context ) do
71
- @widget = Widget .create!
72
- end
69
+ ``` ruby
70
+ before(:context ) do
71
+ @widget = Widget .create!
72
+ end
73
73
74
- after(:context ) do
75
- @widget .destroy
76
- end
77
- ```
74
+ after(:context ) do
75
+ @widget .destroy
76
+ end
77
+ ```
78
78
79
- If you don't do that, you'll leave data lying around that will eventually
79
+ If you don' t do that, you' ll leave data lying around that will eventually
80
80
interfere with other examples.
81
81
82
82
2 . Reload the object in a ` before(:example)` hook.
83
83
84
- ``` ruby
85
- before(:context ) do
86
- @widget = Widget .create!
87
- end
84
+ ` ` ` ruby
85
+ before(:context) do
86
+ @widget = Widget.create!
87
+ end
88
88
89
- before(:example ) do
90
- @widget .reload
91
- end
92
- ```
89
+ before(:example) do
90
+ @widget.reload
91
+ end
92
+ ` ` `
93
93
94
94
Even though database updates in each example will be rolled back, the
95
95
object won' t _know_ about those rollbacks so the object and its backing
You can’t perform that action at this time.
0 commit comments