lfa-wordpress-import/spec/lib/wordpress/category_spec.rb
Marc Remolt ddb65040a7 Refactoring of specs
* split the one large spec file in multiple small, one for each model
* helper for getting dump object in tests
2011-06-05 13:09:06 +02:00

30 lines
725 B
Ruby

require 'spec_helper'
describe Refinery::WordPress::Category, :type => :model do
let(:category) { Refinery::WordPress::Category.new('Rant') }
describe "#name" do
specify { category.name.should == 'Rant' }
end
describe "#==" do
specify { category.should == Refinery::WordPress::Category.new('Rant') }
specify { category.should_not == Refinery::WordPress::Category.new('Tutorials') }
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