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
182d3fb8
Commit
182d3fb8
authored
Oct 01, 2019
by
Robert Speicher
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'let_it_be' into 'master'
let_it_be for spec/controllers See merge request gitlab-org/gitlab!17680
parents
40e31aa0
b0409589
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
86 additions
and
64 deletions
+86
-64
doc/development/testing_guide/best_practices.md
doc/development/testing_guide/best_practices.md
+28
-0
spec/controllers/admin/clusters_controller_spec.rb
spec/controllers/admin/clusters_controller_spec.rb
+2
-2
spec/controllers/admin/requests_profiles_controller_spec.rb
spec/controllers/admin/requests_profiles_controller_spec.rb
+1
-1
spec/controllers/admin/users_controller_spec.rb
spec/controllers/admin/users_controller_spec.rb
+1
-1
spec/controllers/groups/clusters_controller_spec.rb
spec/controllers/groups/clusters_controller_spec.rb
+3
-3
spec/controllers/groups/labels_controller_spec.rb
spec/controllers/groups/labels_controller_spec.rb
+7
-7
spec/controllers/groups/shared_projects_controller_spec.rb
spec/controllers/groups/shared_projects_controller_spec.rb
+3
-3
spec/controllers/import/bitbucket_server_controller_spec.rb
spec/controllers/import/bitbucket_server_controller_spec.rb
+1
-1
spec/controllers/import/gitlab_projects_controller_spec.rb
spec/controllers/import/gitlab_projects_controller_spec.rb
+2
-2
spec/controllers/projects/artifacts_controller_spec.rb
spec/controllers/projects/artifacts_controller_spec.rb
+3
-3
spec/controllers/projects/autocomplete_sources_controller_spec.rb
...trollers/projects/autocomplete_sources_controller_spec.rb
+4
-4
spec/controllers/projects/clusters_controller_spec.rb
spec/controllers/projects/clusters_controller_spec.rb
+3
-3
spec/controllers/projects/commit_controller_spec.rb
spec/controllers/projects/commit_controller_spec.rb
+4
-3
spec/controllers/projects/environments/prometheus_api_controller_spec.rb
...s/projects/environments/prometheus_api_controller_spec.rb
+3
-3
spec/controllers/projects/environments_controller_spec.rb
spec/controllers/projects/environments_controller_spec.rb
+3
-3
spec/controllers/projects/error_tracking_controller_spec.rb
spec/controllers/projects/error_tracking_controller_spec.rb
+2
-2
spec/controllers/projects/mirrors_controller_spec.rb
spec/controllers/projects/mirrors_controller_spec.rb
+1
-1
spec/controllers/projects/pipeline_schedules_controller_spec.rb
...ontrollers/projects/pipeline_schedules_controller_spec.rb
+3
-11
spec/controllers/projects/pipelines_controller_spec.rb
spec/controllers/projects/pipelines_controller_spec.rb
+1
-1
spec/controllers/projects/pipelines_settings_controller_spec.rb
...ontrollers/projects/pipelines_settings_controller_spec.rb
+2
-2
spec/controllers/projects/settings/ci_cd_controller_spec.rb
spec/controllers/projects/settings/ci_cd_controller_spec.rb
+2
-2
spec/controllers/projects/settings/operations_controller_spec.rb
...ntrollers/projects/settings/operations_controller_spec.rb
+2
-2
spec/controllers/projects/wikis_controller_spec.rb
spec/controllers/projects/wikis_controller_spec.rb
+2
-2
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+1
-1
spec/controllers/search_controller_spec.rb
spec/controllers/search_controller_spec.rb
+1
-1
spec/spec_helper.rb
spec/spec_helper.rb
+1
-0
No files found.
doc/development/testing_guide/best_practices.md
View file @
182d3fb8
...
...
@@ -202,8 +202,36 @@ so we need to set some guidelines for their use going forward:
order is required, otherwise
`let`
will suffice. Remember that
`let`
is lazy and won't
be evaluated until it is referenced.
### `let_it_be` variables
In some cases there is no need to recreate the same object for tests
again for each example. For example, a project is needed to test issues
on the same project, one project will do for the entire file. This can
be achieved by using
[
`let_it_be`
](
https://test-prof.evilmartians.io/#/let_it_be
)
variables
from the
[
`test-prof` gem
](
https://rubygems.org/gems/test-prof
)
.
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.
```
let_it_be(:project, reload: true) { create(:project) }
```
You can also specify the
`refind`
option as well to completely load a
new object.
```
let_it_be(:project, refind: true) { create(:project) }
```
### `set` variables
NOTE:
**Note:**
We are incrementally removing
`set`
in favour of
`let_it_be`
. See the
[
removal issue
](
https://gitlab.com/gitlab-org/gitlab/issues/27922
)
.
In some cases there is no need to recreate the same object for tests again for
each example. For example, a project is needed to test issues on the same
project, one project will do for the entire file. This can be achieved by using
...
...
spec/controllers/admin/clusters_controller_spec.rb
View file @
182d3fb8
...
...
@@ -469,7 +469,7 @@ describe Admin::ClustersController do
end
describe
'security'
do
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:instance
)
}
let_it_be
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:instance
)
}
it
{
expect
{
put_update
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
put_update
}.
to
be_denied_for
(
:user
)
}
...
...
@@ -531,7 +531,7 @@ describe Admin::ClustersController do
end
describe
'security'
do
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
:instance
)
}
let_it_be
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
:instance
)
}
it
{
expect
{
delete_destroy
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
delete_destroy
}.
to
be_denied_for
(
:user
)
}
...
...
spec/controllers/admin/requests_profiles_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
describe
Admin
::
RequestsProfilesController
do
set
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
before
do
sign_in
(
admin
)
...
...
spec/controllers/admin/users_controller_spec.rb
View file @
182d3fb8
...
...
@@ -4,7 +4,7 @@ require 'spec_helper'
describe
Admin
::
UsersController
do
let
(
:user
)
{
create
(
:user
)
}
set
(
:admin
)
{
create
(
:admin
)
}
let_it_be
(
:admin
)
{
create
(
:admin
)
}
before
do
sign_in
(
admin
)
...
...
spec/controllers/groups/clusters_controller_spec.rb
View file @
182d3fb8
...
...
@@ -6,7 +6,7 @@ describe Groups::ClustersController do
include
AccessMatchersForController
include
GoogleApi
::
CloudPlatformHelpers
set
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -536,7 +536,7 @@ describe Groups::ClustersController do
end
describe
'security'
do
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
cluster_type: :group_type
,
groups:
[
group
])
}
let_it_be
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
cluster_type: :group_type
,
groups:
[
group
])
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
group
)
}
...
...
@@ -604,7 +604,7 @@ describe Groups::ClustersController do
end
describe
'security'
do
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
cluster_type: :group_type
,
groups:
[
group
])
}
let_it_be
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
cluster_type: :group_type
,
groups:
[
group
])
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
group
)
}
...
...
spec/controllers/groups/labels_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
Groups
::
LabelsController
do
set
(
:group
)
{
create
(
:group
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
before
do
group
.
add_owner
(
user
)
...
...
@@ -14,8 +14,8 @@ describe Groups::LabelsController do
end
describe
'GET #index'
do
set
(
:label_1
)
{
create
(
:label
,
project:
project
,
title:
'label_1'
)
}
set
(
:group_label_1
)
{
create
(
:group_label
,
group:
group
,
title:
'group_label_1'
)
}
let_it_be
(
:label_1
)
{
create
(
:label
,
project:
project
,
title:
'label_1'
)
}
let_it_be
(
:group_label_1
)
{
create
(
:group_label
,
group:
group
,
title:
'group_label_1'
)
}
it
'returns group and project labels by default'
do
get
:index
,
params:
{
group_id:
group
},
format: :json
...
...
@@ -25,8 +25,8 @@ describe Groups::LabelsController do
end
context
'with ancestor group'
do
set
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
set
(
:subgroup_label_1
)
{
create
(
:group_label
,
group:
subgroup
,
title:
'subgroup_label_1'
)
}
let_it_be
(
:subgroup
)
{
create
(
:group
,
parent:
group
)
}
let_it_be
(
:subgroup_label_1
)
{
create
(
:group_label
,
group:
subgroup
,
title:
'subgroup_label_1'
)
}
before
do
subgroup
.
add_owner
(
user
)
...
...
spec/controllers/groups/shared_projects_controller_spec.rb
View file @
182d3fb8
...
...
@@ -17,9 +17,9 @@ describe Groups::SharedProjectsController do
).
execute
(
group
)
end
set
(
:group
)
{
create
(
:group
)
}
set
(
:user
)
{
create
(
:user
)
}
set
(
:shared_project
)
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:shared_project
)
do
shared_project
=
create
(
:project
,
namespace:
user
.
namespace
)
share_project
(
shared_project
)
...
...
spec/controllers/import/bitbucket_server_controller_spec.rb
View file @
182d3fb8
...
...
@@ -39,7 +39,7 @@ describe Import::BitbucketServerController do
assign_session_tokens
end
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
it
'returns the new project'
do
allow
(
Gitlab
::
BitbucketServerImport
::
ProjectCreator
)
...
...
spec/controllers/import/gitlab_projects_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Import
::
GitlabProjectsController
do
set
(
:namespace
)
{
create
(
:namespace
)
}
set
(
:user
)
{
namespace
.
owner
}
let_it_be
(
:namespace
)
{
create
(
:namespace
)
}
let_it_be
(
:user
)
{
namespace
.
owner
}
let
(
:file
)
{
fixture_file_upload
(
'spec/fixtures/project_export.tar.gz'
,
'text/plain'
)
}
before
do
...
...
spec/controllers/projects/artifacts_controller_spec.rb
View file @
182d3fb8
...
...
@@ -4,9 +4,9 @@ require 'spec_helper'
describe
Projects
::
ArtifactsController
do
let
(
:user
)
{
project
.
owner
}
set
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
,
:public
)
}
set
(
:pipelin
e
)
do
let_it_be
(
:pipeline
,
reload:
tru
e
)
do
create
(
:ci_pipeline
,
project:
project
,
sha:
project
.
commit
.
sha
,
...
...
@@ -48,7 +48,7 @@ describe Projects::ArtifactsController do
it
'paginates artifacts'
do
subject
expect
(
assigns
(
:artifacts
)).
to
contain_exactly
(
project
.
job_artifacts
.
last
)
expect
(
assigns
(
:artifacts
)).
to
contain_exactly
(
project
.
reload
.
job_artifacts
.
last
)
end
end
end
...
...
spec/controllers/projects/autocomplete_sources_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,10 +3,10 @@
require
'spec_helper'
describe
Projects
::
AutocompleteSourcesController
do
set
(
:group
)
{
create
(
:group
)
}
set
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
set
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
namespace:
group
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
describe
'GET members'
do
before
do
...
...
spec/controllers/projects/clusters_controller_spec.rb
View file @
182d3fb8
...
...
@@ -7,7 +7,7 @@ describe Projects::ClustersController do
include
GoogleApi
::
CloudPlatformHelpers
include
KubernetesHelpers
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -536,7 +536,7 @@ describe Projects::ClustersController do
end
describe
'security'
do
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
let_it_be
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
...
...
@@ -605,7 +605,7 @@ describe Projects::ClustersController do
end
describe
'security'
do
set
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
}
let_it_be
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
:production_environment
,
projects:
[
project
])
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:admin
)
}
it
{
expect
{
go
}.
to
be_allowed_for
(
:owner
).
of
(
project
)
}
...
...
spec/controllers/projects/commit_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,9 +3,10 @@
require
'spec_helper'
describe
Projects
::
CommitController
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
set
(
:user
)
{
create
(
:user
)
}
let
(
:commit
)
{
project
.
commit
(
"master"
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:commit
)
{
project
.
commit
(
"master"
)
}
let
(
:master_pickable_sha
)
{
'7d3b0f7cff5f37573aea97cebfd5692ea1689924'
}
let
(
:master_pickable_commit
)
{
project
.
commit
(
master_pickable_sha
)
}
...
...
spec/controllers/projects/environments/prometheus_api_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,9 +3,9 @@
require
'spec_helper'
describe
Projects
::
Environments
::
PrometheusApiController
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:environment
)
{
create
(
:environment
,
project:
project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_reporter
(
user
)
...
...
spec/controllers/projects/environments_controller_spec.rb
View file @
182d3fb8
...
...
@@ -5,10 +5,10 @@ require 'spec_helper'
describe
Projects
::
EnvironmentsController
do
include
MetricsDashboardHelpers
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
set
(
:environment
)
do
let_it_be
(
:environment
)
do
create
(
:environment
,
name:
'production'
,
project:
project
)
end
...
...
spec/controllers/projects/error_tracking_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Projects
::
ErrorTrackingController
do
set
(
:project
)
{
create
(
:project
)
}
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
before
do
sign_in
(
user
)
...
...
spec/controllers/projects/mirrors_controller_spec.rb
View file @
182d3fb8
...
...
@@ -6,7 +6,7 @@ describe Projects::MirrorsController do
include
ReactiveCachingHelpers
describe
'setting up a remote mirror'
do
set
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
context
'when the current project is not a mirror'
do
it
'allows to create a remote mirror'
do
...
...
spec/controllers/projects/pipeline_schedules_controller_spec.rb
View file @
182d3fb8
...
...
@@ -5,9 +5,9 @@ require 'spec_helper'
describe
Projects
::
PipelineSchedulesController
do
include
AccessMatchersForController
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
set
(
:pipeline_schedule
)
{
create
(
:ci_pipeline_schedule
,
project:
project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let_it_be
(
:pipeline_schedule
)
{
create
(
:ci_pipeline_schedule
,
project:
project
)
}
before
do
project
.
add_developer
(
user
)
...
...
@@ -60,8 +60,6 @@ describe Projects::PipelineSchedulesController do
end
describe
'GET #new'
do
set
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
...
...
@@ -77,8 +75,6 @@ describe Projects::PipelineSchedulesController do
describe
'POST #create'
do
describe
'functionality'
do
set
(
:user
)
{
create
(
:user
)
}
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
...
...
@@ -149,7 +145,6 @@ describe Projects::PipelineSchedulesController do
describe
'PUT #update'
do
describe
'functionality'
do
set
(
:user
)
{
create
(
:user
)
}
let!
(
:pipeline_schedule
)
{
create
(
:ci_pipeline_schedule
,
project:
project
,
owner:
user
)
}
before
do
...
...
@@ -383,7 +378,6 @@ describe Projects::PipelineSchedulesController do
end
describe
'POST #play'
,
:clean_gitlab_redis_cache
do
set
(
:user
)
{
create
(
:user
)
}
let
(
:ref
)
{
'master'
}
before
do
...
...
@@ -442,8 +436,6 @@ describe Projects::PipelineSchedulesController do
end
describe
'DELETE #destroy'
do
set
(
:user
)
{
create
(
:user
)
}
context
'when a developer makes the request'
do
before
do
project
.
add_developer
(
user
)
...
...
spec/controllers/projects/pipelines_controller_spec.rb
View file @
182d3fb8
...
...
@@ -5,7 +5,7 @@ require 'spec_helper'
describe
Projects
::
PipelinesController
do
include
ApiHelpers
set
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:feature
)
{
ProjectFeature
::
ENABLED
}
...
...
spec/controllers/projects/pipelines_settings_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Projects
::
PipelinesSettingsController
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project_auto_devops
)
{
create
(
:project_auto_devops
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project_auto_devops
)
{
create
(
:project_auto_devops
)
}
let
(
:project
)
{
project_auto_devops
.
project
}
before
do
...
...
spec/controllers/projects/settings/ci_cd_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,8 +3,8 @@
require
(
'spec_helper'
)
describe
Projects
::
Settings
::
CiCdController
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project_auto_devops
)
{
create
(
:project_auto_devops
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project_auto_devops
)
{
create
(
:project_auto_devops
)
}
let
(
:project
)
{
project_auto_devops
.
project
}
before
do
...
...
spec/controllers/projects/settings/operations_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Projects
::
Settings
::
OperationsController
do
set
(
:user
)
{
create
(
:user
)
}
set
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
before
do
sign_in
(
user
)
...
...
spec/controllers/projects/wikis_controller_spec.rb
View file @
182d3fb8
...
...
@@ -3,8 +3,8 @@
require
'spec_helper'
describe
Projects
::
WikisController
do
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
s
et
(
:user
)
{
project
.
owner
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
l
et
(
:user
)
{
project
.
owner
}
let
(
:project_wiki
)
{
ProjectWiki
.
new
(
project
,
user
)
}
let
(
:wiki
)
{
project_wiki
.
wiki
}
let
(
:wiki_title
)
{
'page title test'
}
...
...
spec/controllers/projects_controller_spec.rb
View file @
182d3fb8
...
...
@@ -149,7 +149,7 @@ describe ProjectsController do
end
context
'when the storage is not available'
,
:broken_storage
do
set
(
:project
)
{
create
(
:project
,
:broken_storage
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:broken_storage
)
}
before
do
project
.
add_developer
(
user
)
...
...
spec/controllers/search_controller_spec.rb
View file @
182d3fb8
...
...
@@ -67,7 +67,7 @@ describe SearchController do
using
RSpec
::
Parameterized
::
TableSyntax
render_views
set
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:wiki_repo
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
:wiki_repo
)
}
before
do
expect
(
::
Gitlab
::
GitalyClient
).
to
receive
(
:allow_ref_name_caching
).
and_call_original
...
...
spec/spec_helper.rb
View file @
182d3fb8
...
...
@@ -10,6 +10,7 @@ require 'rspec/rails'
require
'shoulda/matchers'
require
'rspec/retry'
require
'rspec-parameterized'
require
"test_prof/recipes/rspec/let_it_be"
rspec_profiling_is_configured
=
ENV
[
'RSPEC_PROFILING_POSTGRES_URL'
].
present?
||
...
...
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