Cross Reference:
xref
: /
ontohub
/
test
/
functional
/
users_controller_test.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
users_controller_test.rb revision 38dab3b63e2730b443590a53de93e085659efe25
require
'test_helper'
class
UsersControllerTest
<
ActionController
::
TestCase
should
route
(:
get
,
"/
users
/
id
"
)
.
to
(:
controller
=> :
users
, :
action
=> :
show
, :
id
=>
'id'
)
context
'User Instance'
do
setup
do
@
user
=
FactoryGirl.create
:
user
end
context
'without data'
do
context
'on GET to show'
do
setup
do
get
:
show
, :
id
=> @
user.to
_param
end
should
assign_to
:
versions
should
assign_to
:
comments
should
respond_with
:
success
should
render_template
:
show
end
end
context
'with data'
do
setup
do
OntologyVersion.any_instance.expects
(:
parse_async
)
.
once
FactoryGirl.create
:
comment
, :
user
=> @
user
FactoryGirl.create
:
ontology_version_with_file
, :
user
=> @
user
end
context
'on GET to show'
do
setup
do
get
:
show
, :
id
=> @
user.to
_param
end
should
assign_to
:
versions
should
assign_to
:
comments
should
respond_with
:
success
should
render_template
:
show
end
end
end
end