2011-06-05 11:09:06 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2014-03-04 22:47:53 +00:00
|
|
|
describe WordPressImport::Author, :type => :model do
|
2011-06-05 11:09:06 +00:00
|
|
|
let(:author) { test_dump.authors.first }
|
|
|
|
|
2011-06-05 15:43:30 +00:00
|
|
|
specify { author.login.should == 'admin' }
|
|
|
|
specify { author.email.should == 'admin@example.com' }
|
2011-06-05 11:09:06 +00:00
|
|
|
|
|
|
|
describe "#to_refinery" do
|
|
|
|
before do
|
|
|
|
@user = author.to_refinery
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should create a User object" do
|
|
|
|
User.should have(1).record
|
|
|
|
@user.should be_a(User)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "the @user should be persisted" do
|
|
|
|
@user.should be_persisted
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should have copied the attributes from Refinery::WordPress::Author" do
|
|
|
|
author.login.should == @user.username
|
|
|
|
author.email.should == @user.email
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|