Skip to content

Commit

Permalink
Add specs for #1581.
Browse files Browse the repository at this point in the history
  • Loading branch information
ugisozols committed Apr 10, 2012
1 parent a5c84f1 commit 09becb0
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions pages/spec/requests/refinery/admin/pages_spec.rb
Expand Up @@ -506,6 +506,39 @@ module Admin
end
end
end

describe 'advanced options' do
describe 'view and layout templates' do
context 'when parent page has templates set' do
before(:each) do
Refinery::Pages.stub(:use_layout_templates).and_return(true)
Refinery::Pages.stub(:use_view_templates).and_return(true)
Refinery::Pages.stub(:layout_template_whitelist).and_return(['abc', 'refinery'])
Refinery::Pages.stub(:view_template_whitelist).and_return(['abc', 'refinery'])
Refinery::Pages.stub(:valid_templates).and_return(['abc', 'refinery'])
parent_page = FactoryGirl.create(:page, :view_template => 'refinery',
:layout_template => 'refinery')
FactoryGirl.create(:page, :parent_id => parent_page)
end

specify 'sub page should inherit them' do
visit refinery.admin_pages_path

within '.nested' do
click_link 'Edit this page'
end

within '#page_layout_template' do
page.find('option[value=refinery]').selected?.should eq('selected')
end

within '#page_view_template' do
page.find('option[value=refinery]').selected?.should eq('selected')
end
end
end
end
end
end

describe "TranslatePages" do
Expand Down

0 comments on commit 09becb0

Please sign in to comment.