From 2581895c7cfcd958866d76c75e656d8e5ca2f54b Mon Sep 17 00:00:00 2001 From: Marc Remolt Date: Mon, 6 Jun 2011 19:39:27 +0200 Subject: [PATCH] Updated test dump and adapted specs * We now have a second attachment, a simple text file --- spec/fixtures/wordpress_dump.xml | 63 ++++++++++++++++++++++----- spec/lib/wordpress/attachment_spec.rb | 3 +- spec/lib/wordpress/dump_spec.rb | 2 +- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/spec/fixtures/wordpress_dump.xml b/spec/fixtures/wordpress_dump.xml index 0653e30..3951383 100644 --- a/spec/fixtures/wordpress_dump.xml +++ b/spec/fixtures/wordpress_dump.xml @@ -16,7 +16,7 @@ - + My test blog http://localhost/wordpress Just another WordPress site - Sun, 05 Jun 2011 15:27:27 +0000 + Mon, 06 Jun 2011 17:36:50 +0000 en 1.1 http://localhost/wordpress @@ -69,6 +69,10 @@ 0 + + _edit_last + + 1 @@ -91,14 +95,10 @@ admin http://localhost/wordpress/?page_id=2 - Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piña coladas. (And gettin' caught in the rain.) - -...or something like this: - -
The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickies to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.
- + Hi there! I'm a bike messenger by day, aspiring actor by night, and this is my blog. I live in Los Angeles, have a great dog named Jack, and I like piƱa coladas. (And gettin' caught in the rain.) +...or something like this: +
The XYZ Doohickey Company was founded in 1971, and has been providing quality doohickies to the public ever since. Located in Gotham City, XYZ employs over 2,000 people and does all kinds of awesome things for the Gotham community.
As a new WordPress user, you should go to your dashboard to delete this page and create new pages for your content. Have fun!]]>
2 @@ -117,6 +117,10 @@ As a new WordPress user, you should go to This is my CV, please download! + Duis metus tellus, pellentesque ut, luctus id, egestas a, lorem. Praesent vitae mauris. Aliquam sed nulla. Sed id nunc vitae leo suscipit viverra. Proin at leo ut lacus consequat rhoncus. In hac habitasse platea dictumst. Nunc quis tortor sed libero hendrerit dapibus. Integer interdum purus id erat. Duis nec velit vitae dolor mattis euismod. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Suspendisse pellentesque dignissim lacus. Nulla semper euismod arcu. Suspendisse egestas, erat a consectetur dapibus, felis orci cursus eros, et sollicitudin purus urna et metus. Integer eget est sed nunc euismod vestibulum. Integer nulla dui, tristique in, euismod et, interdum imperdiet, enim. Mauris at lectus. Sed egestas tortor nec mi.]]>
@@ -286,7 +292,7 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per incepto Sun, 05 Jun 2011 15:26:51 +0000 admin http://localhost/wordpress/wp-content/uploads/2011/05/200px-Tux.svg_.png - Tux, the Linux mascot + 13 @@ -310,6 +316,41 @@ Class aptent taciti sociosqu ad litora torquent per conubia nostra, per incepto _wp_attachment_metadata + + _wp_attachment_image_alt + + + + + cv + http://localhost/wordpress/?attachment_id=18 + Mon, 06 Jun 2011 17:27:50 +0000 + admin + http://localhost/wordpress/wp-content/uploads/2011/05/cv.txt + + + + 18 + 2011-06-06 17:27:50 + 2011-06-06 17:27:50 + open + open + cv + inherit + 10 + 0 + attachment + + 0 + http://localhost/wordpress/wp-content/uploads/2011/05/cv.txt + + _wp_attached_file + + + + _wp_attachment_metadata + +
diff --git a/spec/lib/wordpress/attachment_spec.rb b/spec/lib/wordpress/attachment_spec.rb index 8221a0b..e3ff42b 100644 --- a/spec/lib/wordpress/attachment_spec.rb +++ b/spec/lib/wordpress/attachment_spec.rb @@ -4,7 +4,8 @@ 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' } + # doesn't get exported atm. for some reason + specify { attachment.description.should == '' } specify { attachment.url.should == 'http://localhost/wordpress/wp-content/uploads/2011/05/200px-Tux.svg_.png' } specify { attachment.file_name.should == '200px-Tux.svg_.png' } specify { attachment.post_date.should == DateTime.new(2011, 6, 5, 15, 26, 51) } diff --git a/spec/lib/wordpress/dump_spec.rb b/spec/lib/wordpress/dump_spec.rb index e1389f8..6fdcdec 100644 --- a/spec/lib/wordpress/dump_spec.rb +++ b/spec/lib/wordpress/dump_spec.rb @@ -77,7 +77,7 @@ describe Refinery::WordPress::Dump, :type => :model do describe "#attachments" do it "should return all attachments" do - dump.attachments.should have(1).attachment + dump.attachments.should have(2).attachments end specify { dump.attachments.first.should be_a(Refinery::WordPress::Attachment) }