Cross Reference: formality_levels_controller_spec.rb
xref
: /
ontohub
/
spec
/
controllers
/
api
/
v1
/
formality_levels_controller_spec.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
require
'spec_helper'
describe
Api
::
V1
::
FormalityLevelsController
do
context
'on GET to show'
do
let
(:
formality_level
)
{
create
:
formality_level
}
context
'requesting json representation'
,
api_specification
:
true
do
let
(:
formality_level_schema
)
{
schema_for
(
'formality_level'
)
}
before
do
get
:
show
,
id
:
formality_level.to
_param
,
format
: :
json
end
it
{
should
respond_with
:
success
}
it
'respond with json content type'
do
expect
(
response.content_type.to
_s
)
.
to
eq
(
'
application
/
json
'
)
end
it
'should return a representation that validates against the schema'
do
VCR.use
_cassette
'
api
/
json-schemata
/
formality_level
'
do
expect
(
response.body
)
.
to
match_json_schema
(
formality_level_schema
)
end
end
end
end
end