spec/unit/entities/page_spec.rb in locomotivecms_steam-1.1.2 vs spec/unit/entities/page_spec.rb in locomotivecms_steam-1.2.0.beta1
- old
+ new
@@ -31,10 +31,29 @@
it { is_expected.to eq true }
end
end
+ describe '#layout?' do
+
+ let(:attributes) { { fullpath: { en: 'foo/layouts' } } }
+
+ subject { page.layout? }
+ it { is_expected.to eq false }
+
+ context 'true if starting by layouts' do
+ let(:attributes) { { fullpath: { en: 'layouts/base' } } }
+ it { is_expected.to eq true }
+ end
+
+ context 'true if the root layouts page' do
+ let(:attributes) { { fullpath: { en: 'layouts' } } }
+ it { is_expected.to eq true }
+ end
+
+ end
+
describe '#valid?' do
subject { page.valid? }
it { is_expected.to eq true }
@@ -72,9 +91,19 @@
it { is_expected.to eq false }
end
end
+
+ end
+
+ describe '#source' do
+
+ let(:attributes) { { 'raw_template' => 'template code here' } }
+
+ subject { page.source }
+
+ it { is_expected.to eq 'template code here'}
end
end