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
df08b4ff
Commit
df08b4ff
authored
Nov 16, 2020
by
Felipe Artur
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move quality_test_cases factory to EE folder
Move test cases related specs and factory to EE folder
parent
5ac5f7f3
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
80 additions
and
34 deletions
+80
-34
ee/spec/controllers/dashboard_controller_spec.rb
ee/spec/controllers/dashboard_controller_spec.rb
+27
-0
ee/spec/controllers/ee/groups_controller_spec.rb
ee/spec/controllers/ee/groups_controller_spec.rb
+12
-0
ee/spec/factories/issues.rb
ee/spec/factories/issues.rb
+6
-0
ee/spec/models/issue_spec.rb
ee/spec/models/issue_spec.rb
+16
-0
ee/spec/services/projects/open_issues_count_service_spec.rb
ee/spec/services/projects/open_issues_count_service_spec.rb
+17
-0
spec/controllers/dashboard_controller_spec.rb
spec/controllers/dashboard_controller_spec.rb
+0
-10
spec/controllers/groups_controller_spec.rb
spec/controllers/groups_controller_spec.rb
+0
-9
spec/factories/issues.rb
spec/factories/issues.rb
+0
-4
spec/models/issue_spec.rb
spec/models/issue_spec.rb
+2
-3
spec/services/projects/open_issues_count_service_spec.rb
spec/services/projects/open_issues_count_service_spec.rb
+0
-8
No files found.
ee/spec/controllers/dashboard_controller_spec.rb
0 → 100644
View file @
df08b4ff
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
DashboardController
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
context
'signed in'
do
before
do
project
.
add_developer
(
user
)
sign_in
(
user
)
end
describe
'GET issues'
do
it
'does not list test cases'
do
issue
=
create
(
:incident
,
project:
project
,
author:
user
)
incident
=
create
(
:incident
,
project:
project
,
author:
user
)
create
(
:quality_test_case
,
project:
project
,
author:
user
)
get
:issues
,
params:
{
author_id:
user
.
id
}
expect
(
assigns
(
:issues
)).
to
match_array
([
issue
,
incident
])
end
end
end
end
ee/spec/controllers/ee/groups_controller_spec.rb
View file @
df08b4ff
...
@@ -19,6 +19,18 @@ RSpec.describe GroupsController do
...
@@ -19,6 +19,18 @@ RSpec.describe GroupsController do
it_behaves_like
'namespace storage limit alert'
it_behaves_like
'namespace storage limit alert'
end
end
describe
'GET #issues'
do
it
'does not list test cases'
do
issue
=
create
(
:issue
,
project:
project
,
title:
'foo'
)
incident
=
create
(
:incident
,
project:
project
)
create
(
:quality_test_case
,
project:
project
)
get
:issues
,
params:
{
id:
group
.
to_param
}
expect
(
assigns
(
:issues
)).
to
match_array
([
issue
,
incident
])
end
end
describe
'GET #activity'
do
describe
'GET #activity'
do
render_views
render_views
...
...
ee/spec/factories/issues.rb
View file @
df08b4ff
...
@@ -9,3 +9,9 @@ FactoryBot.modify do
...
@@ -9,3 +9,9 @@ FactoryBot.modify do
end
end
end
end
end
end
FactoryBot
.
define
do
factory
:quality_test_case
,
parent: :issue
do
issue_type
{
:test_case
}
end
end
ee/spec/models/issue_spec.rb
View file @
df08b4ff
...
@@ -936,4 +936,20 @@ RSpec.describe Issue do
...
@@ -936,4 +936,20 @@ RSpec.describe Issue do
end
end
end
end
end
end
describe
'.with_issue_type'
do
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:test_case
)
{
create
(
:quality_test_case
,
project:
project
)
}
it
'gives issues with test case type'
do
expect
(
described_class
.
with_issue_type
(
'test_case'
))
.
to
contain_exactly
(
test_case
)
end
it
'gives issues with the given issue types list'
do
expect
(
described_class
.
with_issue_type
(
%w(issue test_case)
))
.
to
contain_exactly
(
issue
,
test_case
)
end
end
end
end
ee/spec/services/projects/open_issues_count_service_spec.rb
0 → 100644
View file @
df08b4ff
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
Projects
::
OpenIssuesCountService
,
:use_clean_rails_memory_store_caching
do
let
(
:project
)
{
create
(
:project
)
}
describe
'#count'
do
it
'does not count test cases'
do
create
(
:issue
,
:opened
,
project:
project
)
create
(
:incident
,
:opened
,
project:
project
)
create
(
:quality_test_case
,
:opened
,
project:
project
)
expect
(
described_class
.
new
(
project
).
count
).
to
eq
(
2
)
end
end
end
spec/controllers/dashboard_controller_spec.rb
View file @
df08b4ff
...
@@ -15,16 +15,6 @@ RSpec.describe DashboardController do
...
@@ -15,16 +15,6 @@ RSpec.describe DashboardController do
describe
'GET issues'
do
describe
'GET issues'
do
it_behaves_like
'issuables list meta-data'
,
:issue
,
:issues
it_behaves_like
'issuables list meta-data'
,
:issue
,
:issues
it_behaves_like
'issuables requiring filter'
,
:issues
it_behaves_like
'issuables requiring filter'
,
:issues
it
'lists only incidents and issues'
do
issue
=
create
(
:incident
,
project:
project
,
author:
user
)
incident
=
create
(
:incident
,
project:
project
,
author:
user
)
create
(
:quality_test_case
,
project:
project
,
author:
user
)
get
:issues
,
params:
{
author_id:
user
.
id
}
expect
(
assigns
(
:issues
)).
to
match_array
([
issue
,
incident
])
end
end
end
describe
'GET merge requests'
do
describe
'GET merge requests'
do
...
...
spec/controllers/groups_controller_spec.rb
View file @
df08b4ff
...
@@ -400,15 +400,6 @@ RSpec.describe GroupsController, factory_default: :keep do
...
@@ -400,15 +400,6 @@ RSpec.describe GroupsController, factory_default: :keep do
sign_in
(
user
)
sign_in
(
user
)
end
end
it
'lists only incidents and issues'
do
incident
=
create
(
:incident
,
project:
project
)
create
(
:quality_test_case
,
project:
project
)
get
:issues
,
params:
{
id:
group
.
to_param
}
expect
(
assigns
(
:issues
)).
to
match_array
([
issue_1
,
issue_2
,
incident
])
end
context
'sorting by votes'
do
context
'sorting by votes'
do
it
'sorts most popular issues'
do
it
'sorts most popular issues'
do
get
:issues
,
params:
{
id:
group
.
to_param
,
sort:
'upvotes_desc'
}
get
:issues
,
params:
{
id:
group
.
to_param
,
sort:
'upvotes_desc'
}
...
...
spec/factories/issues.rb
View file @
df08b4ff
...
@@ -52,9 +52,5 @@ FactoryBot.define do
...
@@ -52,9 +52,5 @@ FactoryBot.define do
factory
:incident
do
factory
:incident
do
issue_type
{
:incident
}
issue_type
{
:incident
}
end
end
factory
:quality_test_case
do
issue_type
{
:test_case
}
end
end
end
end
end
spec/models/issue_spec.rb
View file @
df08b4ff
...
@@ -141,7 +141,6 @@ RSpec.describe Issue do
...
@@ -141,7 +141,6 @@ RSpec.describe Issue do
describe
'.with_issue_type'
do
describe
'.with_issue_type'
do
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
reusable_project
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
reusable_project
)
}
let_it_be
(
:incident
)
{
create
(
:incident
,
project:
reusable_project
)
}
let_it_be
(
:incident
)
{
create
(
:incident
,
project:
reusable_project
)
}
let_it_be
(
:test_case
)
{
create
(
:quality_test_case
,
project:
reusable_project
)
}
it
'gives issues with the given issue type'
do
it
'gives issues with the given issue type'
do
expect
(
described_class
.
with_issue_type
(
'issue'
))
expect
(
described_class
.
with_issue_type
(
'issue'
))
...
@@ -149,8 +148,8 @@ RSpec.describe Issue do
...
@@ -149,8 +148,8 @@ RSpec.describe Issue do
end
end
it
'gives issues with the given issue type'
do
it
'gives issues with the given issue type'
do
expect
(
described_class
.
with_issue_type
(
%w(issue incident
test_case
)
))
expect
(
described_class
.
with_issue_type
(
%w(issue incident)
))
.
to
contain_exactly
(
issue
,
incident
,
test_case
)
.
to
contain_exactly
(
issue
,
incident
)
end
end
end
end
...
...
spec/services/projects/open_issues_count_service_spec.rb
View file @
df08b4ff
...
@@ -10,14 +10,6 @@ RSpec.describe Projects::OpenIssuesCountService, :use_clean_rails_memory_store_c
...
@@ -10,14 +10,6 @@ RSpec.describe Projects::OpenIssuesCountService, :use_clean_rails_memory_store_c
it_behaves_like
'a counter caching service'
it_behaves_like
'a counter caching service'
describe
'#count'
do
describe
'#count'
do
it
'does not count test cases'
do
create
(
:issue
,
:opened
,
project:
project
)
create
(
:incident
,
:opened
,
project:
project
)
create
(
:quality_test_case
,
:opened
,
project:
project
)
expect
(
described_class
.
new
(
project
).
count
).
to
eq
(
2
)
end
context
'when user is nil'
do
context
'when user is nil'
do
it
'does not include confidential issues in the issue count'
do
it
'does not include confidential issues in the issue count'
do
create
(
:issue
,
:opened
,
project:
project
)
create
(
:issue
,
:opened
,
project:
project
)
...
...
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