Image import working

* bundle update
* replacement of image URLs now considers wordpress thumbnails (like -150x150)
* added Guard for autotesting
This commit is contained in:
Marc Remolt
2011-06-13 15:02:40 +02:00
parent 7265d31f62
commit a24ea686fa
11 changed files with 139 additions and 25 deletions

View File

@@ -28,6 +28,8 @@ describe Refinery::WordPress::Attachment, :type => :model do
end
describe "#replace_image_url" do
let(:post) { BlogPost.first }
before do
test_dump.authors.each(&:to_refinery)
test_dump.posts.each(&:to_refinery)
@@ -36,11 +38,15 @@ describe Refinery::WordPress::Attachment, :type => :model do
attachment.replace_image_url_in_blog_posts
end
specify { post.body.should_not include attachment.url }
specify { post.body.should_not include '200px-Tux.svg_-150x150.png' }
specify { post.body.should_not include 'wp-content' }
it "should replace attachment urls in the generated BlogPosts" do
BlogPost.first.body.should_not include(attachment.url)
BlogPost.first.body.should include(@image.image.url)
post.body.should include(@image.image.url)
end
end
end
@@ -52,5 +58,11 @@ describe Refinery::WordPress::Attachment, :type => :model do
specify { attachment.file_name.should == 'cv.txt' }
specify { attachment.post_date.should == DateTime.new(2011, 6, 6, 17, 27, 50) }
specify { attachment.should_not be_an_image }
describe '#to_refinery' do
it "should raise an exception for now" do
lambda { attachment.to_refinery }.should raise_error
end
end
end
end