spec/posts_archive_spec.rb in awestruct-0.5.0.cr vs spec/posts_archive_spec.rb in awestruct-0.5.0
- old
+ new
@@ -1,8 +1,8 @@
require 'awestruct/extensions/posts'
require 'awestruct/util/inflector'
-require 'hashery/open_cascade'
+require 'hashery'
describe Awestruct::Extensions::Posts do
it "should have an empty string as the default path prefix" do
extension = Awestruct::Extensions::Posts.new
@@ -12,13 +12,13 @@
it "should have :posts as the default assign_to" do
extension = Awestruct::Extensions::Posts.new('/posts')
extension.assign_to.should == :posts
end
- it "should have a nil archive template by default" do
+ it "should have 'posts' as a layout by default" do
extension = Awestruct::Extensions::Posts.new('/posts', :posts)
- extension.archive_template.should be_nil
+ extension.default_layout.should eql 'posts'
end
it "should have a nil archive template by default" do
extension = Awestruct::Extensions::Posts.new('/posts', :posts)
extension.archive_path.should be_nil
@@ -51,10 +51,10 @@
extension.default_layout.should == 'post'
end
it "should assign default layout if specified to post without layout" do
extension = Awestruct::Extensions::Posts.new( '/posts', :news, nil, nil, :default_layout => 'post' )
- site = OpenCascade.new :encoding=>false
+ site = Hashery::OpenCascade[ { :encoding=>false } ]
page = __create_page( 2012, 8, 9, '/posts/mock-post.md' )
page.stub(:layout).and_return(nil)
page.should_receive(:layout=).with('post')
page.stub(:slug).and_return(nil, 'mock-post')
page.should_receive(:slug=).with('mock-post')