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
8a4b8776
Commit
8a4b8776
authored
Feb 18, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace set with let_it_be in spec/helpers
Removes usage of `set` in specs
parent
308e8f7e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
24 deletions
+24
-24
spec/helpers/auto_devops_helper_spec.rb
spec/helpers/auto_devops_helper_spec.rb
+2
-2
spec/helpers/boards_helper_spec.rb
spec/helpers/boards_helper_spec.rb
+1
-1
spec/helpers/environments_helper_spec.rb
spec/helpers/environments_helper_spec.rb
+3
-3
spec/helpers/labels_helper_spec.rb
spec/helpers/labels_helper_spec.rb
+7
-7
spec/helpers/markup_helper_spec.rb
spec/helpers/markup_helper_spec.rb
+9
-9
spec/helpers/projects/error_tracking_helper_spec.rb
spec/helpers/projects/error_tracking_helper_spec.rb
+2
-2
No files found.
spec/helpers/auto_devops_helper_spec.rb
View file @
8a4b8776
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
AutoDevopsHelper
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
describe
'.show_auto_devops_callout?'
do
let
(
:allowed
)
{
true
}
...
...
spec/helpers/boards_helper_spec.rb
View file @
8a4b8776
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
BoardsHelper
do
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
describe
'#build_issue_link_base'
do
context
'project board'
do
...
...
spec/helpers/environments_helper_spec.rb
View file @
8a4b8776
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
EnvironmentsHelper
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
describe
'#metrics_data'
do
before
do
...
...
spec/helpers/labels_helper_spec.rb
View file @
8a4b8776
...
...
@@ -35,7 +35,7 @@ describe LabelsHelper do
end
context
'with a group label'
do
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let
(
:label
)
{
create
(
:group_label
,
group:
group
,
title:
'bug'
)
}
context
'when asking for an issue link'
do
...
...
@@ -135,7 +135,7 @@ describe LabelsHelper do
end
describe
'create_label_title'
do
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
context
'with a group as subject'
do
it
'returns "Create group label"'
do
...
...
@@ -144,7 +144,7 @@ describe LabelsHelper do
end
context
'with a project as subject'
do
set
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
it
'returns "Create project label"'
do
expect
(
create_label_title
(
project
)).
to
eq
_
(
'Create project label'
)
...
...
@@ -159,7 +159,7 @@ describe LabelsHelper do
end
describe
'manage_labels_title'
do
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
context
'with a group as subject'
do
it
'returns "Manage group labels"'
do
...
...
@@ -168,7 +168,7 @@ describe LabelsHelper do
end
context
'with a project as subject'
do
set
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
it
'returns "Manage project labels"'
do
expect
(
manage_labels_title
(
project
)).
to
eq
_
(
'Manage project labels'
)
...
...
@@ -183,7 +183,7 @@ describe LabelsHelper do
end
describe
'view_labels_title'
do
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
context
'with a group as subject'
do
it
'returns "View group labels"'
do
...
...
@@ -192,7 +192,7 @@ describe LabelsHelper do
end
context
'with a project as subject'
do
set
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
it
'returns "View project labels"'
do
expect
(
view_labels_title
(
project
)).
to
eq
_
(
'View project labels'
)
...
...
spec/helpers/markup_helper_spec.rb
View file @
8a4b8776
...
...
@@ -3,15 +3,15 @@
require
'spec_helper'
describe
MarkupHelper
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
do
user
=
create
(
:user
,
username:
'gfm'
)
project
.
add_maintainer
(
user
)
user
end
set
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
set
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
set
(
:snippet
)
{
create
(
:project_snippet
,
project:
project
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:merge_request
)
{
create
(
:merge_request
,
source_project:
project
,
target_project:
project
)
}
let_it_be
(
:snippet
)
{
create
(
:project_snippet
,
project:
project
)
}
let
(
:commit
)
{
project
.
commit
}
before
do
...
...
@@ -45,8 +45,8 @@ describe MarkupHelper do
describe
"override default project"
do
let
(
:actual
)
{
issue
.
to_reference
}
set
(
:second_project
)
{
create
(
:project
,
:public
)
}
set
(
:second_issue
)
{
create
(
:issue
,
project:
second_project
)
}
let_it_be
(
:second_project
)
{
create
(
:project
,
:public
)
}
let_it_be
(
:second_issue
)
{
create
(
:issue
,
project:
second_project
)
}
it
'links to the issue'
do
expected
=
urls
.
project_issue_path
(
second_project
,
second_issue
)
...
...
@@ -57,7 +57,7 @@ describe MarkupHelper do
describe
'uploads'
do
let
(
:text
)
{
"![ImageTest](/uploads/test.png)"
}
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
subject
{
helper
.
markdown
(
text
)
}
...
...
@@ -79,7 +79,7 @@ describe MarkupHelper do
end
describe
"with a group in the context"
do
set
(
:project_in_group
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:project_in_group
)
{
create
(
:project
,
group:
group
)
}
before
do
helper
.
instance_variable_set
(
:@group
,
group
)
...
...
spec/helpers/projects/error_tracking_helper_spec.rb
View file @
8a4b8776
...
...
@@ -5,8 +5,8 @@ require 'spec_helper'
describe
Projects
::
ErrorTrackingHelper
do
include
Gitlab
::
Routing
.
url_helpers
set
(
:project
)
{
create
(
:project
)
}
set
(
:current_user
)
{
create
(
:user
)
}
let_it_be
(
:project
,
reload:
true
)
{
create
(
:project
)
}
let_it_be
(
:current_user
)
{
create
(
:user
)
}
describe
'#error_tracking_data'
do
let
(
:can_enable_error_tracking
)
{
true
}
...
...
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