Started on attachment import
* created Attachment * created Dump#attachments * specs * replaced require with autoload
This commit is contained in:
10
spec/lib/wordpress/attachment_spec.rb
Normal file
10
spec/lib/wordpress/attachment_spec.rb
Normal 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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user