Sha256: e729a61a7ec5d2c1fd325e487637c600155e84774079479b22f95dacbb5388a4
Contents?: true
Size: 826 Bytes
Versions: 15
Compression:
Stored size: 826 Bytes
Contents
require 'spec_helper' describe Blog do before :all do @blog = Blog.make end it "returns its path" do @blog.path.should == "/#{@blog.title.to_url}" end it "returns its RSS feed" do @blog.feed.should == "/#{@blog.title.to_url}/feed.rss" end it "retrieves posts by month" do today = Time.zone.now post = @blog.posts.create(Post.make_unsaved.attributes) posts = @blog.posts_by_month posts[today.to_s(:year_month)][:full_date].should == today.to_s(:month_year) posts[today.to_s(:year_month)][:posts].count.should == 1 end it "searches its published posts" do post_1 = @blog.posts.create(Post.make_unsaved(:content => 'foo').attributes) post_2 = @blog.posts.create(Post.make_unsaved(:content => 'bar').attributes) @blog.search('foo').should == [post_1] end end
Version data entries
15 entries across 15 versions & 1 rubygems