Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F461978
schedules_controller_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 18, 7:27 PM
Size
1 KB
Mime Type
text/x-ruby
Expires
Tue, May 20, 7:27 PM (1 d, 5 h)
Engine
blob
Format
Raw Data
Handle
220486
Attached To
rARCHIVING archiving
schedules_controller_spec.rb
View Options
require
'spec_helper'
describe
SchedulesController
do
describe
'GET #new'
do
before
{
get
:new
}
it
'initializes a schedule'
do
expect
(
assigns
(
:schedule
))
.
to
be
end
it
'renders'
do
expect
(
response
)
.
to
render_template
(
:new
)
end
end
describe
'POST #create'
do
context
'with valid params'
do
let
(
:params
)
do
{
schedule
:
{
name
:
FactoryGirl
.
build
(
:schedule
)
.
name
,
runtime
:
'19:17'
}
}
end
it
'creates the schedule'
do
expect
{
post
:create
,
params
}
.
to
change
{
Schedule
.
count
}
.
by
(
1
)
end
it
'redirects to root'
do
post
:create
,
params
expect
(
response
)
.
to
redirect_to
(
root_path
)
end
end
context
'with invalid params'
do
let
(
:params
)
{
{
schedule
:
{
invalide
:
:foo
}
}
}
it
'initializes a schedule with errors'
do
post
:create
,
params
expect
(
assigns
(
:schedule
))
.
to
be
end
it
'does not create the schedule'
do
expect
{
post
:create
,
params
}
.
to_not
change
{
Schedule
.
count
}
end
it
'renders :new'
do
post
:create
,
params
expect
(
response
)
.
to
render_template
(
:new
)
end
end
end
end
Event Timeline
Log In to Comment