Converted to factory_girl use, a little refactored
This commit is contained in:
parent
4a25cde49f
commit
be4c8c3836
6 changed files with 59 additions and 10 deletions
|
@ -1,8 +1,20 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe BlogCategory do
|
||||
it "initializes" do
|
||||
blog = BlogCategory.new
|
||||
blog.should_not be_nil
|
||||
context "wiring up" do
|
||||
|
||||
before(:each) do
|
||||
@category = Factory(:blog_category)
|
||||
end
|
||||
|
||||
it "saves" do
|
||||
@category.should_not be_nil
|
||||
end
|
||||
|
||||
it "has a blog post" do
|
||||
BlogPost.last.categories.should include(@category)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue