Refactoring of specs
* split the one large spec file in multiple small, one for each model * helper for getting dump object in tests
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
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' }
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user