File tree 1 file changed +33
-0
lines changed
pages/spec/requests/refinery/admin
1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -506,6 +506,39 @@ module Admin
506
506
end
507
507
end
508
508
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
509
542
end
510
543
511
544
describe "TranslatePages" do
You can’t perform that action at this time.
0 commit comments