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
6d0d3bfe
Commit
6d0d3bfe
authored
Feb 10, 2021
by
Arturo Herrero
Committed by
Tom Quirk
Feb 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix instance variable and build
parent
672fb06c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
ee/app/controllers/projects/integrations/jira/issues_controller.rb
...ntrollers/projects/integrations/jira/issues_controller.rb
+5
-4
ee/spec/controllers/projects/integrations/jira/issues_controller_spec.rb
...lers/projects/integrations/jira/issues_controller_spec.rb
+13
-9
No files found.
ee/app/controllers/projects/integrations/jira/issues_controller.rb
View file @
6d0d3bfe
...
...
@@ -14,7 +14,6 @@ module Projects
before_action
:check_feature_enabled!
before_action
:check_issues_show_enabled!
,
only: :show
before_action
:issue_json
,
only: :show
before_action
do
push_frontend_feature_flag
(
:jira_issues_integration
,
project
,
type: :licensed
,
default_enabled:
true
)
...
...
@@ -39,7 +38,9 @@ module Projects
def
show
respond_to
do
|
format
|
format
.
html
format
.
html
do
@issue_json
=
issue_json
end
format
.
json
do
render
json:
issue_json
end
...
...
@@ -65,7 +66,7 @@ module Projects
end
def
issue_json
@issue_json
||=
::
Integrations
::
Jira
::
IssueDetailSerializer
.
new
::
Integrations
::
Jira
::
IssueDetailSerializer
.
new
.
represent
(
project
.
jira_service
.
find_issue
(
params
[
:id
],
rendered_fields:
true
),
project:
project
)
end
...
...
ee/spec/controllers/projects/integrations/jira/issues_controller_spec.rb
View file @
6d0d3bfe
...
...
@@ -195,29 +195,33 @@ RSpec.describe Projects::Integrations::Jira::IssuesController do
end
context
'when `jira_issues_show_integration` feature is enabled'
do
let
(
:jira_issue
)
{
{}
}
let
(
:jira_issue
)
{
{
'from'
=>
'jira'
}
}
let
(
:issue_json
)
{
{
'from'
=>
'backend'
}
}
before
do
stub_feature_flags
(
jira_issues_show_integration:
true
)
expect_next_found_instance_of
(
JiraService
)
do
|
service
|
expect
(
service
).
to
receive
(
:find_issue
).
with
(
'1'
,
rendered_fields:
true
).
and_return
(
jira_issue
)
end
expect_next_instance_of
(
Integrations
::
Jira
::
IssueDetailSerializer
)
do
|
serializer
|
expect
(
serializer
).
to
receive
(
:represent
).
with
(
jira_issue
,
project:
project
).
and_return
(
issue_json
)
end
end
it
'renders `show` template'
do
get
:show
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
1
}
expect
(
assigns
(
:issue_json
)).
to
eq
(
issue_json
)
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
expect
(
response
).
to
render_template
(
:show
)
end
it
'returns JSON response'
do
expect_next_found_instance_of
(
JiraService
)
do
|
service
|
expect
(
service
).
to
receive
(
:find_issue
).
with
(
'1'
,
rendered_fields:
true
).
and_return
(
jira_issue
)
end
expect_next_instance_of
(
Integrations
::
Jira
::
IssueDetailSerializer
)
do
|
serializer
|
expect
(
serializer
).
to
receive
(
:represent
).
with
(
jira_issue
,
project:
project
)
end
get
:show
,
params:
{
namespace_id:
project
.
namespace
,
project_id:
project
,
id:
1
,
format: :json
}
expect
(
json_response
).
to
eq
(
issue_json
)
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