Started on attachment import

* created Attachment
* created Dump#attachments
* specs
* replaced require with autoload
This commit is contained in:
Marc Remolt
2011-06-05 17:43:30 +02:00
parent 814c7b4ca8
commit 772cfdc25b
8 changed files with 101 additions and 18 deletions

View File

@@ -0,0 +1,10 @@
require 'spec_helper'
describe Refinery::WordPress::Attachment, :type => :model do
let(:attachment) { test_dump.attachments.first }
specify { attachment.title.should == '200px-Tux.svg' }
specify { attachment.description.should == 'Tux, the Linux mascot' }
specify { attachment.url.should == 'http://localhost/wordpress/wp-content/uploads/2011/05/200px-Tux.svg_.png' }
specify { attachment.post_date.should == DateTime.new(2011, 6, 5, 15, 26, 51) }
end

View File

@@ -3,8 +3,8 @@ require 'spec_helper'
describe Refinery::WordPress::Author, :type => :model do
let(:author) { test_dump.authors.first }
it { author.login.should == 'admin' }
it { author.email.should == 'admin@example.com' }
specify { author.login.should == 'admin' }
specify { author.email.should == 'admin@example.com' }
describe "#to_refinery" do
before do

View File

@@ -66,4 +66,10 @@ describe Refinery::WordPress::Dump, :type => :model do
dump.posts(true).should have(2).posts
end
end
describe "#attachments" do
it "should return all attachments" do
dump.attachments.should have(1).attachment
end
end
end