Improve project feature create spec
What does this MR do?
In this MR we improve the spec spec/features/projects/snippets/create_snippet_spec.rb
. In local, the time went from 1 min and 16 seconds to 47 seconds. Therefore, the improvement is 29 seconds.
Refs #228687 (closed)
Screenshots
Before
Top 7 slowest examples (43.95 seconds, 57.8% of total time):
Projects > Snippets > Create Snippet behaves like snippet editor when a user is authenticated shows collapsible description input
8.96 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:41
Projects > Snippets > Create Snippet behaves like snippet editor when a user is authenticated creates a snippet when all required fields are filled in after validation failing
8.57 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:79
Projects > Snippets > Create Snippet behaves like snippet editor when a user is authenticated uploads a file when dragging into textarea
7.5 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:66
Projects > Snippets > Create Snippet behaves like snippet editor when a user is authenticated creates a new snippet
7.01 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:53
Projects > Snippets > Create Snippet behaves like snippet editor when a user is authenticated when the git operation fails displays the error
5.32 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:115
Projects > Snippets > Create Snippet behaves like snippet editor when a user is authenticated when the git operation fails renders new page
5.21 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:119
Projects > Snippets > Create Snippet behaves like snippet editor when a user is not authenticated shows a public snippet on the index page but not the New snippet button
1.38 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:130
Finished in 1 minute 16.04 seconds (files took 4.43 seconds to load)
After
Top 5 slowest examples (21.31 seconds, 45.3% of total time):
Projects > Snippets > Create Snippet shows collapsible description input
6.2 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:46
Projects > Snippets > Create Snippet creates a new snippet
5.46 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:58
Projects > Snippets > Create Snippet uploads a file when dragging into textarea
4.47 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:71
Projects > Snippets > Create Snippet when the git operation fails renders the new page and displays the error
3 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:106
Projects > Snippets > Create Snippet displays validation errors
2.17 seconds ./spec/features/projects/snippets/create_snippet_spec.rb:84
Finished in 47.08 seconds (files took 3.77 seconds to load)