Cross Reference: permissions_controller_spec.rb
xref
: /
ontohub
/
spec
/
controllers
/
teams
/
permissions_controller_spec.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
require
'spec_helper'
describe
Teams
::
PermissionsController
do
let
!
(:
team
)
{
create
:
team
}
let
!
(:
permission
)
{
create
:
permission
,
subject
:
team
}
context
'on GET to index'
do
context
'not signed in'
do
before
{
get
:
index
,
team_id
:
team.to
_param
}
it
'sets the flash'
do
expect
(
flash
[:
alert
])
.
to
match
(/
not
authorized
/)
end
it
{
should
respond_with
:
redirect
}
end
context
'signed in as normal user'
do
render_views
before
do
sign_in
create
:
user
get
:
index
,
team_id
:
team.to
_param
end
it
{
should
respond_with
:
success
}
it
{
should
render_template
:
index
}
it
{
should
render_template
'
teams
/
permissions
/_permission'
}
end
end
end