diff options
author | Philip Arndt <p@arndt.io> | 2013-09-14 10:00:42 +1200 |
---|---|---|
committer | Philip Arndt <p@arndt.io> | 2013-09-16 04:56:47 +1200 |
commit | a8b5bce609089af8795768230c7dd3a9b87cd5e0 (patch) | |
tree | 22a2a154da2b48988c9c4e05600e52fa1b884bf1 /spec/models | |
parent | 5ae082d79e554d3449083aa70ef64ef5d677759a (diff) | |
download | refinerycms-blog-a8b5bce609089af8795768230c7dd3a9b87cd5e0.tar.gz refinerycms-blog-a8b5bce609089af8795768230c7dd3a9b87cd5e0.tar.bz2 refinerycms-blog-a8b5bce609089af8795768230c7dd3a9b87cd5e0.zip |
Supported Rails 4 and Refinery 3.0.0.dev
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/refinery/blog/category_spec.rb | 4 | ||||
-rw-r--r-- | spec/models/refinery/blog/post_spec.rb | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/spec/models/refinery/blog/category_spec.rb b/spec/models/refinery/blog/category_spec.rb index ad83017..9cd5d97 100644 --- a/spec/models/refinery/blog/category_spec.rb +++ b/spec/models/refinery/blog/category_spec.rb @@ -32,7 +32,7 @@ module Refinery :published_at => Time.now, :author => refinery_user }) - category.posts.first.should == latest_post + category.posts.newest_first.first.should == latest_post end end @@ -47,4 +47,4 @@ module Refinery end end end -end
\ No newline at end of file +end diff --git a/spec/models/refinery/blog/post_spec.rb b/spec/models/refinery/blog/post_spec.rb index cec6a2f..49bfecd 100644 --- a/spec/models/refinery/blog/post_spec.rb +++ b/spec/models/refinery/blog/post_spec.rb @@ -93,8 +93,10 @@ module Refinery end it "returns all posts which aren't in draft and pub date isn't in future" do - described_class.live.count.should be == 2 - described_class.live.should == [@post2, @post1] + live_posts = described_class.live + live_posts.count.should be == 2 + live_posts.should include(@post2) + live_posts.should include(@post1) end end @@ -133,7 +135,7 @@ module Refinery end it "returns next article when called on current article" do - described_class.last.next.should == @post + described_class.newest_first.last.next.should == @post end end |