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
5d5d0ee3
Commit
5d5d0ee3
authored
Nov 19, 2019
by
Sean Arnold
Committed by
Stan Hu
Nov 19, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs and ensure the correct issue id is used
- Added helper spec
parent
f3f04ae3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
5 deletions
+27
-5
app/controllers/projects/error_tracking_controller.rb
app/controllers/projects/error_tracking_controller.rb
+5
-0
app/helpers/projects/error_tracking_helper.rb
app/helpers/projects/error_tracking_helper.rb
+4
-4
app/views/projects/error_tracking/details.html.haml
app/views/projects/error_tracking/details.html.haml
+1
-1
spec/helpers/projects/error_tracking_helper_spec.rb
spec/helpers/projects/error_tracking_helper_spec.rb
+17
-0
No files found.
app/controllers/projects/error_tracking_controller.rb
View file @
5d5d0ee3
...
...
@@ -2,6 +2,7 @@
class
Projects::ErrorTrackingController
<
Projects
::
ApplicationController
before_action
:authorize_read_sentry_issue!
before_action
:set_issue_id
,
only:
[
:details
,
:stack_trace
]
POLLING_INTERVAL
=
10_000
...
...
@@ -113,6 +114,10 @@ class Projects::ErrorTrackingController < Projects::ApplicationController
params
.
permit
(
:issue_id
)
end
def
set_issue_id
@issue_id
=
issue_details_params
[
:issue_id
]
end
def
set_polling_interval
Gitlab
::
PollingInterval
.
set_header
(
response
,
interval:
POLLING_INTERVAL
)
end
...
...
app/helpers/projects/error_tracking_helper.rb
View file @
5d5d0ee3
...
...
@@ -14,12 +14,12 @@ module Projects::ErrorTrackingHelper
}
end
def
error_details_data
(
project
,
issue
)
opts
=
[
project
,
issue
,
{
format: :json
}]
def
error_details_data
(
project
,
issue
_id
)
opts
=
[
project
,
issue
_id
,
{
format: :json
}]
{
'issue-details-path'
=>
details_
namespace_
project_error_tracking_index_path
(
*
opts
),
'issue-stack-trace-path'
=>
stack_trace_
namespace_
project_error_tracking_index_path
(
*
opts
)
'issue-details-path'
=>
details_project_error_tracking_index_path
(
*
opts
),
'issue-stack-trace-path'
=>
stack_trace_project_error_tracking_index_path
(
*
opts
)
}
end
end
app/views/projects/error_tracking/details.html.haml
View file @
5d5d0ee3
-
page_title
_
(
'Error Details'
)
-
add_to_breadcrumbs
'Errors'
,
project_error_tracking_index_path
(
@project
)
#js-error_details
{
data:
error_details_data
(
@
current_user
,
@project
)
}
#js-error_details
{
data:
error_details_data
(
@
project
,
@issue_id
)
}
spec/helpers/projects/error_tracking_helper_spec.rb
View file @
5d5d0ee3
...
...
@@ -75,4 +75,21 @@ describe Projects::ErrorTrackingHelper do
end
end
end
describe
'#error_details_data'
do
let
(
:issue_id
)
{
1234
}
let
(
:route_params
)
{
[
project
.
owner
,
project
,
issue_id
,
{
format: :json
}]
}
let
(
:details_path
)
{
details_namespace_project_error_tracking_index_path
(
*
route_params
)
}
let
(
:stack_trace_path
)
{
stack_trace_namespace_project_error_tracking_index_path
(
*
route_params
)
}
let
(
:result
)
{
helper
.
error_details_data
(
project
,
issue_id
)
}
it
'returns the correct details path'
do
expect
(
result
[
'issue-details-path'
]).
to
eq
details_path
end
it
'returns the correct stack trace path'
do
expect
(
result
[
'issue-stack-trace-path'
]).
to
eq
stack_trace_path
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