Cross Reference: teams_controller_spec.rb
xref
: /
ontohub
/
spec
/
controllers
/
admin
/
teams_controller_spec.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
teams_controller_spec.rb revision 7ca38d75d045fade73b81bff6fdf34f4755d75fb
2d0611ffc9f91c5fc2ddccb93f9a3d17791ae650
takashi
require
'spec_helper'
2d0611ffc9f91c5fc2ddccb93f9a3d17791ae650
takashi
dc0d8d65d35787d30a275895ccad8d8e1b58a5ed
nd
describe
Admin
::
TeamsController
do
dc0d8d65d35787d30a275895ccad8d8e1b58a5ed
nd
context
'on GET to index'
do
dc0d8d65d35787d30a275895ccad8d8e1b58a5ed
nd
context
'not signed in'
do
dc0d8d65d35787d30a275895ccad8d8e1b58a5ed
nd
before
{
get
:
index
}
0066eddda7203f6345b56f77d146a759298dc635
gryzor
0066eddda7203f6345b56f77d146a759298dc635
gryzor
it
'sets the flash'
do
0066eddda7203f6345b56f77d146a759298dc635
gryzor
expect
(
flash
[:
error
])
.
to
match
(/
admin
privileges
/)
0066eddda7203f6345b56f77d146a759298dc635
gryzor
end
6ae232055d4d8a97267517c5e50074c2c819941a
nd
dc0d8d65d35787d30a275895ccad8d8e1b58a5ed
nd
it
{
should
respond_with
:
redirect
}
6ae232055d4d8a97267517c5e50074c2c819941a
nd
end
a78048ccbdb6256da15e6b0e7e95355e480c2301
nd
a78048ccbdb6256da15e6b0e7e95355e480c2301
nd
context
'signed in as normal user'
do
a78048ccbdb6256da15e6b0e7e95355e480c2301
nd
before
do
a78048ccbdb6256da15e6b0e7e95355e480c2301
nd
sign_in
create
:
user
f3ec420152ca921e4c1ce77782f51b53f659018d
nd
get
:
index
f3ec420152ca921e4c1ce77782f51b53f659018d
nd
end
f3ec420152ca921e4c1ce77782f51b53f659018d
nd
f3ec420152ca921e4c1ce77782f51b53f659018d
nd
it
'sets the flash'
do
expect
(
flash
[:
error
])
.
to
match
(/
admin
privileges
/)
end
it
{
should
respond_with
:
redirect
}
end
context
'signed in as admin user'
do
before
do
sign_in
create
:
admin
get
:
index
end
it
{
should
respond_with
:
success
}
end
end
end