Beginning to remove refinery stuff

This commit is contained in:
2014-03-04 15:47:53 -07:00
parent 1e1f3574eb
commit 60ce62ad1b
29 changed files with 530 additions and 744 deletions

View File

@@ -1,6 +1,6 @@
require 'spec_helper'
describe Refinery::WordPress::Attachment, :type => :model do
describe WordPressImport::Attachment, :type => :model do
context "an image attchment" do
let(:attachment) { test_dump.attachments.first }

View File

@@ -1,6 +1,6 @@
require 'spec_helper'
describe Refinery::WordPress::Author, :type => :model do
describe WordPressImport::Author, :type => :model do
let(:author) { test_dump.authors.first }
specify { author.login.should == 'admin' }

View File

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

View File

@@ -1,10 +1,10 @@
require 'spec_helper'
describe Refinery::WordPress::Dump, :type => :model do
describe WordPressImport::Dump, :type => :model do
let(:dump) { test_dump }
it "should create a Dump object given a xml file" do
dump.should be_a Refinery::WordPress::Dump
dump.should be_a WordPressImport::Dump
end
it "should include a Nokogiri::XML object" do
@@ -13,12 +13,12 @@ describe Refinery::WordPress::Dump, :type => :model do
describe "#tags" do
let(:tags) do
[ Refinery::WordPress::Tag.new('css'), Refinery::WordPress::Tag.new('html'),
Refinery::WordPress::Tag.new('php'), Refinery::WordPress::Tag.new('ruby')]
[ WordPressImport::Tag.new('css'), WordPressImport::Tag.new('html'),
WordPressImport::Tag.new('php'), WordPressImport::Tag.new('ruby')]
end
specify { dump.tags.count == 4 }
specify { dump.tags.first.should be_a(Refinery::WordPress::Tag) }
specify { dump.tags.first.should be_a(WordPressImport::Tag) }
it "should return all included tags" do
tags.each do |tag|
@@ -29,12 +29,12 @@ describe Refinery::WordPress::Dump, :type => :model do
describe "#categories" do
let(:categories) do
[ Refinery::WordPress::Category.new('Rant'), Refinery::WordPress::Category.new('Tutorials'),
Refinery::WordPress::Category.new('Uncategorized') ]
[ WordPressImport::Category.new('Rant'), WordPressImport::Category.new('Tutorials'),
WordPressImport::Category.new('Uncategorized') ]
end
specify { dump.categories.count == 4 }
specify { dump.categories.first.should be_a(Refinery::WordPress::Category) }
specify { dump.categories.first.should be_a(WordPressImport::Category) }
it "should return all included categories" do
categories.each do |cat|
@@ -48,7 +48,7 @@ describe Refinery::WordPress::Dump, :type => :model do
dump.pages.should have(3).pages
end
specify { dump.pages.first.should be_a(Refinery::WordPress::Page) }
specify { dump.pages.first.should be_a(WordPressImport::Page) }
it "should return only published pages with only_published=true" do
dump.pages(true).should have(2).pages
@@ -60,7 +60,7 @@ describe Refinery::WordPress::Dump, :type => :model do
dump.authors.should have(1).author
end
specify { dump.authors.first.should be_a(Refinery::WordPress::Author) }
specify { dump.authors.first.should be_a(WordPressImport::Author) }
end
describe "#posts" do
@@ -68,7 +68,7 @@ describe Refinery::WordPress::Dump, :type => :model do
dump.posts.should have(3).posts
end
specify { dump.posts.first.should be_a(Refinery::WordPress::Post) }
specify { dump.posts.first.should be_a(WordPressImport::Post) }
it "should return only published posts with only_published=true" do
dump.posts(true).should have(2).posts
@@ -80,6 +80,6 @@ describe Refinery::WordPress::Dump, :type => :model do
dump.attachments.should have(2).attachments
end
specify { dump.attachments.first.should be_a(Refinery::WordPress::Attachment) }
specify { dump.attachments.first.should be_a(WordPressImport::Attachment) }
end
end

View File

@@ -1,6 +1,6 @@
require 'spec_helper'
describe Refinery::WordPress::Page, :type => :model do
describe WordPressImport::Page, :type => :model do
let(:dump) { test_dump }
let(:page) { test_dump.pages.last }

View File

@@ -1,6 +1,6 @@
require 'spec_helper'
describe Refinery::WordPress::Post, :type => :model do
describe WordPressImport::Post, :type => :model do
let(:post) { test_dump.posts.last }
specify { post.title.should == 'Third blog post' }
@@ -17,15 +17,15 @@ describe Refinery::WordPress::Post, :type => :model do
describe "#categories" do
specify { post.categories.should have(1).category }
specify { post.categories.first.should == Refinery::WordPress::Category.new('Rant') }
specify { post.categories.first.should == WordPressImport::Category.new('Rant') }
end
describe "#tags" do
specify { post.tags.should have(3).tags }
specify { post.tags.should include(Refinery::WordPress::Tag.new('css')) }
specify { post.tags.should include(Refinery::WordPress::Tag.new('html')) }
specify { post.tags.should include(Refinery::WordPress::Tag.new('php')) }
specify { post.tags.should include(WordPressImport::Tag.new('css')) }
specify { post.tags.should include(WordPressImport::Tag.new('html')) }
specify { post.tags.should include(WordPressImport::Tag.new('php')) }
end
specify { post.tag_list.should == 'css,html,php' }

View File

@@ -1,15 +1,15 @@
require 'spec_helper'
describe Refinery::WordPress::Tag, :type => :model do
let(:tag) { Refinery::WordPress::Tag.new('ruby') }
describe WordPressImport::Tag, :type => :model do
let(:tag) { WordPressImport::Tag.new('ruby') }
describe "#name" do
specify { tag.name.should == 'ruby' }
end
describe "#==" do
specify { tag.should == Refinery::WordPress::Tag.new('ruby') }
specify { tag.should_not == Refinery::WordPress::Tag.new('php') }
specify { tag.should == WordPressImport::Tag.new('ruby') }
specify { tag.should_not == WordPressImport::Tag.new('php') }
end
describe "#to_refinery" do

View File

@@ -1,7 +0,0 @@
require 'spec_helper'
describe Refinery::WordPress do
it "should be valid" do
Refinery::WordPress.should be_a(Module)
end
end

View File

@@ -1,11 +1,11 @@
module Refinery::WordPress::SpecHelpers
module WordPressImport::SpecHelpers
def test_dump
file_name = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/wordpress_dump.xml'))
Refinery::WordPress::Dump.new(file_name)
WordPressImport::Dump.new(file_name)
end
end
RSpec.configure do |config|
config.include Refinery::WordPress::SpecHelpers
config.include WordPressImport::SpecHelpers
end

View File

@@ -0,0 +1,7 @@
require 'spec_helper'
describe WordPressImport do
it "should be valid" do
WordPressImport.should be_a(Module)
end
end