Skip to content

Commit 09becb0

Browse files
committed
Add specs for #1581.
1 parent a5c84f1 commit 09becb0

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

pages/spec/requests/refinery/admin/pages_spec.rb

+33
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,39 @@ module Admin
506506
end
507507
end
508508
end
509+
510+
describe 'advanced options' do
511+
describe 'view and layout templates' do
512+
context 'when parent page has templates set' do
513+
before(:each) do
514+
Refinery::Pages.stub(:use_layout_templates).and_return(true)
515+
Refinery::Pages.stub(:use_view_templates).and_return(true)
516+
Refinery::Pages.stub(:layout_template_whitelist).and_return(['abc', 'refinery'])
517+
Refinery::Pages.stub(:view_template_whitelist).and_return(['abc', 'refinery'])
518+
Refinery::Pages.stub(:valid_templates).and_return(['abc', 'refinery'])
519+
parent_page = FactoryGirl.create(:page, :view_template => 'refinery',
520+
:layout_template => 'refinery')
521+
FactoryGirl.create(:page, :parent_id => parent_page)
522+
end
523+
524+
specify 'sub page should inherit them' do
525+
visit refinery.admin_pages_path
526+
527+
within '.nested' do
528+
click_link 'Edit this page'
529+
end
530+
531+
within '#page_layout_template' do
532+
page.find('option[value=refinery]').selected?.should eq('selected')
533+
end
534+
535+
within '#page_view_template' do
536+
page.find('option[value=refinery]').selected?.should eq('selected')
537+
end
538+
end
539+
end
540+
end
541+
end
509542
end
510543

511544
describe "TranslatePages" do

0 commit comments

Comments
 (0)