Skip to content

Use let_it_be for a feature spec

Thong Kuah requested to merge let_it_be_feature_branches_spec into master

What does this MR do and why?

Use let_it_be for a feature spec (spec/features/projects/branches_spec.rb)

We don't really write to project, or user.

Screenshots or screen recordings

Before:

$ bundle exec rspec /Users/tkuah/code/gdk-ee/gitlab/./spec/features/projects/branches_spec.rb
warning: parser/current is loading parser/ruby27, which recognizes2.7.6-compliant syntax, but you are running 2.7.5.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Test environment set up in 9.074638 seconds
......Starting the Capybara driver server...
Capybara starting Puma...
* Version 5.6.5 , codename: Birdie's Version
* Min threads: 0, max threads: 4
* Listening on unix:///var/folders/gr/1dm_jlrd4g9_724jr3dmrrtm0000gn/T/20220922-88045-fetikp
.................

Finished in 2 minutes 37.1 seconds (files took 13.24 seconds to load)
23 examples, 0 failures

[TEST PROF INFO] Time spent in factories: 01:16.504 (48.04% of total time)

After:

$ bundle exec rspec /Users/tkuah/code/gdk-ee/gitlab/./spec/features/projects/branches_spec.rb
warning: parser/current is loading parser/ruby27, which recognizes2.7.6-compliant syntax, but you are running 2.7.5.
Please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Run options: include {:focus=>true}

All examples were filtered out; ignoring {:focus=>true}

Test environment set up in 7.220889 seconds
......Starting the Capybara driver server...
Capybara starting Puma...
* Version 5.6.5 , codename: Birdie's Version
* Min threads: 0, max threads: 4
* Listening on unix:///var/folders/gr/1dm_jlrd4g9_724jr3dmrrtm0000gn/T/20220922-90439-1pezd34
.................

Finished in 1 minute 23.5 seconds (files took 15.54 seconds to load)
23 examples, 0 failures

[TEST PROF INFO] Time spent in factories: 00:12.149 (14.18% of total time)

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Thong Kuah

Merge request reports