1 # -*- encoding: utf-8 -*-
\r
7 @license = Factory :license
8 @user = Factory( :user_yas)
11 @panel = Factory :panel
12 @speech_balloon_template = Factory :speech_balloon_template
13 @speech_balloon = Factory :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
\r
17 it 'オーソドックスなデータなら通る' do
18 @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id
19 @speech.should be_valid
22 context 'speech_balloon_idを検証するとき' do
24 @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id
27 @speech.speech_balloon_id = @speech_balloon.id
28 @speech.should be_valid
31 @speech.speech_balloon_id = nil
32 @speech.should_not be_valid
35 @speech.speech_balloon_id = 'a'
36 @speech.should_not be_valid
38 it '存在するフキダシコミックでなければ失敗する' do
39 @speech.speech_balloon_id = 0
40 @speech.should_not be_valid
43 context 'contentを検証するとき' do
47 @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id
51 @speech.should be_valid
55 @speech.should_not be_valid
59 @speech.should_not be_valid
63 @speech.should be_valid
67 @speech.should be_valid
72 @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id
76 @speech.should be_valid
80 @speech.should_not be_valid
84 @speech.should_not be_valid
88 @speech.should be_valid
92 @speech.should be_valid
95 context 'widthを検証するとき' do
97 @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id
101 @speech.should be_valid
105 @speech.should_not be_valid
109 @speech.should_not be_valid
113 @speech.should_not be_valid
117 @speech.should_not be_valid
120 context 'heightを検証するとき' do
122 @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id
126 @speech.should be_valid
130 @speech.should_not be_valid
134 @speech.should_not be_valid
138 @speech.should_not be_valid
142 @speech.should_not be_valid
145 context 'settingsを検証するとき' do
147 @speech = Factory.build :speech, :speech_balloon_id => @speech_balloon.id
150 @speech.settings = ''
151 @speech.should be_valid