+# -*- encoding: utf-8 -*-
+#作家
require 'spec_helper'
describe Author do
- pending "add some examples to (or delete) #{__FILE__}"
+ before do
+ Factory :admin
+ @user = Factory( :user_yas)
+ @author = @user.author
+ end
+
+ describe '自動補充に於いて' do
+ #作家はユーザ作成で自動作成されちゃってる
+ it '名前がno nameになっている' do
+ @author.name.should eq 'no name'
+ end
+ end
+
+ describe '絵師作家判定に於いて' do
+ before do
+ end
+ context 'Trueのケース' do
+ it 'リンクされた絵師がある' do
+ artist = Factory :artist, :author_id => @author.id
+ @author.artist?.should eq true
+ end
+ end
+ context 'Falseのケース' do
+ it 'リンクされた絵師がない' do
+ @author.artist?.should eq false
+ end
+ end
+ end
+
end