2011-06-05 11:09:06 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2014-03-04 22:47:53 +00:00
|
|
|
describe WordPressImport::Category, :type => :model do
|
|
|
|
let(:category) { WordPressImport::Category.new('Rant') }
|
2011-06-05 11:09:06 +00:00
|
|
|
|
|
|
|
describe "#name" do
|
|
|
|
specify { category.name.should == 'Rant' }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "#==" do
|
2014-03-04 22:47:53 +00:00
|
|
|
specify { category.should == WordPressImport::Category.new('Rant') }
|
|
|
|
specify { category.should_not == WordPressImport::Category.new('Tutorials') }
|
2011-06-05 11:09:06 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe "#to_refinery" do
|
|
|
|
before do
|
|
|
|
@category = category.to_refinery
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should create a BlogCategory" do
|
|
|
|
BlogCategory.should have(1).record
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should copy the name over to the BlogCategory object" do
|
|
|
|
@category.title.should == category.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|