Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: bf9200d2e2
Fetching contributors…

Cannot retrieve contributors at this time

76 lines (63 sloc) 1.788 kb
require 'spec_helper'
describe NestiveController do
render_views
context '#area' do
it 'is empty by default' do
get :index
assert_select '#empty-area', ''
end
it 'shows initial value if any' do
get :index
assert_select 'title', 'Nestive'
end
it 'can accept blocks as initial value' do
get :index
assert_select '#some-area', 'Some content'
end
end
context '#append' do
it 'appends content to area as a string' do
get :append
assert_select 'title', 'Nestive is awesome'
end
it 'appends content to area as a block' do
get :append
assert_select '#some-area', "Some content\n Another content"
end
end
context '#prepend' do
it 'prepends content to area as a string' do
get :prepend
assert_select 'title', 'Awesome Nestive'
end
it 'prepends content to area as a block' do
get :prepend
assert_select '#some-area', "Prepended\n Some content"
end
end
context '#replace' do
it 'replaces area content with string' do
get :replace
assert_select 'title', 'Lolwut'
end
it 'replaces area content with block' do
get :replace
assert_select '#some-area', 'replaced'
end
end
context '#extends' do
it 'extends layouts' do
get :extended_one
assert_select 'p', 'extended: one'
assert_select 'title', 'extended: one'
assert_select 'h2', 'extended: one'
end
it 'can extend already extended layouts' do
get :extended_two
assert_select 'p', 'extended: two'
assert_select 'title', 'extended: one'
assert_select '#some-area', 'extended: two'
assert_select 'h2', 'extended: one'
end
end
end
Jump to Line
Something went wrong with that request. Please try again.