Permalink
Browse files

better word_count specs

  • Loading branch information...
1 parent 5e6e967 commit 4a8dce5515cc32735b20562d77e79d7236285e5d @steveklabnik steveklabnik committed Jan 9, 2012
Showing with 4 additions and 2 deletions.
  1. +2 −1 spec/models/articles_spec.rb
  2. +2 −1 spec/models/comment_spec.rb
@@ -60,7 +60,8 @@
context "#word_count" do
it "gives the total number of words" do
- article.word_count.should eq(article.body.split.count)
+ article = Fabricate(:article, :body => "Four score and seven years ago...")
+ article.word_count.should eq(6)
end
end
end
@@ -47,7 +47,8 @@
context "#word_count" do
it "gives the total number of words" do
- @comment.word_count.should eq(@comment.body.split.count)
+ comment = Fabricate(:article, :body => "Four score and seven years ago...")
+ comment.word_count.should eq(6)
end
end
end

0 comments on commit 4a8dce5

Please sign in to comment.