Cross Reference:
xref
: /
ontohub
/
test
/
functional
/
teams_controller_test.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
teams_controller_test.rb revision 38dab3b63e2730b443590a53de93e085659efe25
577
N/A
require
'test_helper'
577
N/A
577
N/A
class
TeamsControllerTest
<
ActionController
::
TestCase
577
N/A
615
N/A
should_map_resources
:
teams
810
N/A
577
N/A
context
'not signed in'
do
577
N/A
context
'on GET to index'
do
577
N/A
setup
do
577
N/A
get
:
index
577
N/A
end
577
N/A
577
N/A
should
set_the_flash.to
(/
not
authorized
/)
577
N/A
should
redirect_to
(
"root path"
)
{ :
root
}
577
N/A
end
577
N/A
end
577
N/A
577
N/A
context
'signed in'
do
577
N/A
setup
do
577
N/A
@
user
=
FactoryGirl.create
:
user
577
N/A
sign_in
@
user
577
N/A
end
577
N/A
577
N/A
context
'on GET to index without teams'
do
577
N/A
setup
do
577
N/A
get
:
index
577
N/A
end
577
N/A
577
N/A
should
respond_with
:
success
577
N/A
should
render_template
:
index
577
N/A
should
assign_to
(:
team_users
)
.
with
{ [] }
577
N/A
end
577
N/A
577
N/A
context
'on GET to new'
do
577
N/A
setup
do
577
N/A
get
:
new
577
N/A
end
705
N/A
577
N/A
should
respond_with
:
success
577
N/A
should
render_template
:
new
606
N/A
end
606
N/A
577
N/A
context
'with teams'
do
577
N/A
setup
do
577
N/A
@
team
=
FactoryGirl.create
:
team
,
577
N/A
:
admin_user
=> @
user
577
N/A
end
577
N/A
577
N/A
context
'on GET to index'
do
577
N/A
setup
do
577
N/A
get
:
index
577
N/A
end
577
N/A
577
N/A
should
respond_with
:
success
577
N/A
should
render_template
:
index
577
N/A
end
577
N/A
577
N/A
context
'on GET to show'
do
577
N/A
setup
do
615
N/A
get
:
show
, :
id
=> @
team.to
_param
615
N/A
end
615
N/A
810
N/A
should
respond_with
:
success
810
N/A
should
render_template
:
show
810
N/A
should
assign_to
:
team_users
810
N/A
end
577
N/A
577
N/A
context
'on GET to edit'
do
577
N/A
setup
do
810
N/A
get
:
edit
, :
id
=> @
team.to
_param
577
N/A
end
577
N/A
577
N/A
should
respond_with
:
success
577
N/A
should
render_template
:
edit
577
N/A
end
577
N/A
577
N/A
context
'on DELETE to destroy'
do
577
N/A
context
'by team admin'
do
577
N/A
setup
do
577
N/A
delete
:
destroy
, :
id
=> @
team.id
810
N/A
end
577
N/A
577
N/A
should
redirect_to
(
"index"
)
{ :
teams
}
577
N/A
should
set_the_flash.to
(/
destroyed
/)
577
N/A
end
577
N/A
577
N/A
context
'by non-admin'
do
577
N/A
setup
do
@
member
=
FactoryGirl.create
:
user
@
team.users
<< @
member
sign_in
@
member
delete
:
destroy
, :
id
=> @
team.id
end
should
redirect_to
(
"root"
)
{ :
root
}
should
set_the_flash.to
(/
not
authorized
/)
end
end
end
end
end