aboutsummaryrefslogtreecommitdiffstats
path: root/spec/models/blog_category_spec.rb
diff options
context:
space:
mode:
authorPhilip Arndt <parndt@gmail.com>2011-06-29 13:23:21 +1200
committerPhilip Arndt <parndt@gmail.com>2011-06-29 13:23:48 +1200
commitb725799fef031ca253e30236e5286edfd85c5cc8 (patch)
tree4f2f017b1b118c782e90076e31714fe540d3fd9d /spec/models/blog_category_spec.rb
parentcf335800dad86ef9631bf83ccdd5c4855cc40153 (diff)
downloadrefinerycms-blog-b725799fef031ca253e30236e5286edfd85c5cc8.tar.gz
refinerycms-blog-b725799fef031ca253e30236e5286edfd85c5cc8.tar.bz2
refinerycms-blog-b725799fef031ca253e30236e5286edfd85c5cc8.zip
Refactored the spec suite to be consistent.
Diffstat (limited to 'spec/models/blog_category_spec.rb')
-rw-r--r--spec/models/blog_category_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/models/blog_category_spec.rb b/spec/models/blog_category_spec.rb
index 8ddec46..7792744 100644
--- a/spec/models/blog_category_spec.rb
+++ b/spec/models/blog_category_spec.rb
@@ -3,7 +3,7 @@ Dir[File.expand_path('../../../features/support/factories/*.rb', __FILE__)].each
describe BlogCategory do
before(:each) do
- @blog_category = Factory(:blog_category)
+ @blog_category = Factory.create(:blog_category)
end
describe "validations" do
@@ -20,20 +20,20 @@ describe BlogCategory do
it "has a posts attribute" do
@blog_category.should respond_to(:posts)
end
-
+
it "returns posts by published_at date in descending order" do
first_post = @blog_category.posts.create!({ :title => "Breaking News: Joe Sak is hot stuff you guys!!", :body => "True story.", :published_at => Time.now.yesterday })
- latest_post = @blog_category.posts.create!({ :title => "parndt is p. okay", :body => "For a kiwi.", :published_at => Time.now })
+ latest_post = @blog_category.posts.create!({ :title => "parndt is p. okay", :body => "For a Kiwi.", :published_at => Time.now })
@blog_category.posts.first.should == latest_post
end
-
+
end
describe "#post_count" do
it "returns post count in category" do
2.times do
- @blog_category.posts << Factory(:post)
+ @blog_category.posts << Factory.create(:blog_post)
end
@blog_category.post_count.should == 2
end