Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fizzy_api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Compsy
fizzy_api
Commits
c9d65b51
Commit
c9d65b51
authored
8 years ago
by
Ando Emerencia
Browse files
Options
Downloads
Patches
Plain Diff
added 202 for synchronous render controller
parent
6b5cdb95
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!12
Added 202 for synchronous render controller
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/fizzy/api/endpoints/render_graph_synchronous.rb
+3
-0
3 additions, 0 deletions
lib/fizzy/api/endpoints/render_graph_synchronous.rb
spec/fizzy/api/endpoints/render_graph_synchronous_spec.rb
+14
-0
14 additions, 0 deletions
spec/fizzy/api/endpoints/render_graph_synchronous_spec.rb
with
17 additions
and
0 deletions
lib/fizzy/api/endpoints/render_graph_synchronous.rb
+
3
−
0
View file @
c9d65b51
...
...
@@ -18,6 +18,9 @@ module Fizzy
def
invalid_response
(
response
)
case
response
.
code
when
202
raise
Errors
::
OutcomeNotAvailableError
,
select_measurement_text
(
response
,
'The results have not yet been calculated.'
)
when
204
raise
Errors
::
TooFewMeasurementsError
,
select_measurement_text
(
response
,
'Not enough measurements available.'
)
...
...
This diff is collapsed.
Click to expand it.
spec/fizzy/api/endpoints/render_graph_synchronous_spec.rb
+
14
−
0
View file @
c9d65b51
...
...
@@ -30,6 +30,20 @@ module Fizzy
end
describe
'error handling'
do
it
'should notice a 202'
do
allow
(
response
).
to
receive
(
:code
).
and_return
202
expect
(
session
).
to
receive
(
:get
)
.
with
(
"/dossier/
#{
dossier_id
}
/protocol_subscriptions/
#{
protocol_subscription_id
}
/render_sync/
#{
path
}
"
,
options
)
.
and_return
(
response
)
outcome
=
lambda
do
described_class
.
run!
dossier_id:
dossier_id
,
protocol_subscription_id:
protocol_subscription_id
,
path:
path
,
options:
options
end
expect
{
outcome
.
call
}.
to
raise_error
(
Errors
::
OutcomeNotAvailableError
)
end
it
'should notice a 204'
do
allow
(
response
).
to
receive
(
:code
).
and_return
204
expect
(
session
).
to
receive
(
:get
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment