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
c1753347
Commit
c1753347
authored
Sep 06, 2017
by
Sean McGivern
Committed by
Bryce Johnson
Sep 07, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix EE IssuesController specs
parent
6ff7a738
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
58 deletions
+54
-58
spec/ee/spec/controllers/projects/issues_controller_spec.rb
spec/ee/spec/controllers/projects/issues_controller_spec.rb
+54
-5
spec/ee/spec/controllers/projects/issues_controller_spec.rb~c187b69... Add specs for issues#service_desk action
...ec.rb~c187b69... Add specs for issues#service_desk action
+0
-53
No files found.
spec/ee/spec/controllers/projects/issues_controller_spec.rb
View file @
c1753347
require
(
'spec_helper'
)
describe
Projects
::
IssuesController
do
let
(
:namespace
)
{
create
(
:namespace
)
}
let
(
:project
)
{
create
(
:project_empty_repo
,
namespace:
namespace
)
}
let
(
:namespace
)
{
create
(
:group
,
:public
)
}
let
(
:project
)
{
create
(
:project_empty_repo
,
:public
,
namespace:
namespace
)
}
describe
'POST export_csv'
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:viewer
)
{
user
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
describe
'POST export_csv'
do
let
(
:globally_licensed
)
{
false
}
before
do
...
...
@@ -61,6 +61,7 @@ describe Projects::IssuesController do
context
'licensed by namespace'
do
let
(
:globally_licensed
)
{
true
}
let
(
:namespace
)
{
create
(
:group
,
:private
,
plan:
Namespace
::
BRONZE_PLAN
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
namespace
)
}
before
do
stub_application_setting
(
check_namespace_plan:
true
)
...
...
@@ -192,4 +193,52 @@ describe Projects::IssuesController do
end
end
end
describe
'GET service_desk'
do
def
get_service_desk
(
extra_params
=
{})
get
:service_desk
,
extra_params
.
merge
(
namespace_id:
project
.
namespace
,
project_id:
project
)
end
context
'when Service Desk is available on the project'
do
let
(
:support_bot
)
{
User
.
support_bot
}
let
(
:other_user
)
{
create
(
:user
)
}
let!
(
:service_desk_issue_1
)
{
create
(
:issue
,
project:
project
,
author:
support_bot
)
}
let!
(
:service_desk_issue_2
)
{
create
(
:issue
,
project:
project
,
author:
support_bot
,
assignees:
[
other_user
])
}
let!
(
:other_user_issue
)
{
create
(
:issue
,
project:
project
,
author:
other_user
)
}
before
do
stub_licensed_features
(
service_desk:
true
)
end
it
'adds an author filter for the support bot user'
do
get_service_desk
expect
(
assigns
(
:issues
)).
to
contain_exactly
(
service_desk_issue_1
,
service_desk_issue_2
)
end
it
'does not allow any other author to be set'
do
get_service_desk
(
author_username:
other_user
.
username
)
expect
(
assigns
(
:issues
)).
to
contain_exactly
(
service_desk_issue_1
,
service_desk_issue_2
)
end
it
'supports other filters'
do
get_service_desk
(
assignee_username:
other_user
.
username
)
expect
(
assigns
(
:issues
)).
to
contain_exactly
(
service_desk_issue_2
)
end
end
context
'when Service Desk is not available on the project'
do
before
do
stub_licensed_features
(
service_desk:
false
)
end
it
'returns a 404'
do
get_service_desk
expect
(
response
).
to
have_http_status
(
404
)
end
end
end
end
spec/ee/spec/controllers/projects/issues_controller_spec.rb~c187b69... Add specs for issues#service_desk action
deleted
100644 → 0
View file @
6ff7a738
require 'spec_helper'
describe Projects::IssuesController do
let(:project) { create(:project, :public) }
describe 'GET service_desk' do
def get_service_desk(extra_params = {})
get :service_desk, extra_params.merge(namespace_id: project.namespace, project_id: project)
end
context 'when Service Desk is available on the project' do
let(:support_bot) { User.support_bot }
let(:other_user) { create(:user) }
let!(:service_desk_issue_1) { create(:issue, project: project, author: support_bot) }
let!(:service_desk_issue_2) { create(:issue, project: project, author: support_bot, assignees: [other_user]) }
let!(:other_user_issue) { create(:issue, project: project, author: other_user) }
before do
stub_licensed_features(service_desk: true)
end
it 'adds an author filter for the support bot user' do
get_service_desk
expect(assigns(:issues)).to contain_exactly(service_desk_issue_1, service_desk_issue_2)
end
it 'does not allow any other author to be set' do
get_service_desk(author_username: other_user.username)
expect(assigns(:issues)).to contain_exactly(service_desk_issue_1, service_desk_issue_2)
end
it 'supports other filters' do
get_service_desk(assignee_username: other_user.username)
expect(assigns(:issues)).to contain_exactly(service_desk_issue_2)
end
end
context 'when Service Desk is not available on the project' do
before do
stub_licensed_features(service_desk: false)
end
it 'returns a 404' do
get_service_desk
expect(response).to have_http_status(404)
end
end
end
end
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