OSDN Git Service

pass test
[pettanr/pettanr.git] / spec / models / author_spec.rb
1 # -*- encoding: utf-8 -*-
2 #作家
3 require 'spec_helper'
4
5 describe Author do
6   before do
7     Factory :admin
8     @user = Factory( :user_yas)
9     @author = @user.author
10   end
11
12   describe '自動補充に於いて' do
13     #作家はユーザ作成で自動作成されちゃってる
14     it '名前がno nameになっている' do
15       @author.name.should eq 'no name'
16     end
17   end
18   
19   describe '絵師作家判定に於いて' do
20     before do
21     end
22     context 'Trueのケース' do
23       it 'リンクされた絵師がある' do
24         artist = Factory :artist, :author_id => @author.id
25         @author.artist?.should eq true
26       end
27     end
28     context 'Falseのケース' do
29       it 'リンクされた絵師がない' do
30         @author.artist?.should eq false
31       end
32     end
33   end
34   
35 end