else\r
return false\r
is_var = (o) ->\r
- if o.attr('column') \r
- if o.attr('column') == '_destroy' and o.val().length < 1\r
- return false\r
- else\r
- return true\r
- else\r
+ if parseInt(o.attr('no_attr')) > 0\r
return false\r
+ else\r
+ if o.attr('column') \r
+ if o.attr('column') == '_destroy' and o.val().length < 1\r
+ return false\r
+ else\r
+ return true\r
+ else\r
+ return false\r
is_element = (o) ->\r
if o.attr('element_type')\r
return true\r
'balloon'
end
- def field_tree f
- 'panels-' + self.tag_panel_id + '-speech_balloons_attributes-' + self.tag_element_id + '-balloon_attributes-' + f.to_s
+ def tag_new_index
+ if self.get_speech_balloon == nil
+ nil
+ else
+ self.get_speech_balloon.tag_new_index
+ end
end
def self.default_page_size
"position: absolute; width:#{self.get_panel.width}px; height:#{self.get_panel.height}px; z-index:#{self.z}; background-color:##{format("%06x", self.code)}; #{o}"
end
+ def new_index
+ @new_index
+ end
+
+ def new_index= v
+ @new_index = v
+ end
+
def new_panel
@new_panel
end
'ground_color'
end
+ def tag_new_index
+ self.new_index.to_s
+ end
+
def self.default_page_size
25
end
{:src => self.picture.url, :width => tw, :height => th, :alt => self.caption}
end
+ def new_index
+ @new_index
+ end
+
+ def new_index= v
+ @new_index = v
+ end
+
def new_panel
@new_panel
end
'ground_picture'
end
+ def tag_new_index
+ self.new_index.to_s
+ end
+
def repeat_text
@@repeat_texts[self.repeat]
end
Panel.validate_elements_serial validate_serial_list
end
+ def boost
+ @new_element_index = 0
+ self.panel_elements.each do |elm|
+ if elm.new_record?
+ elm.new_index = @new_element_index
+ @new_element_index += 1
+ end
+ end
+ end
+
def store attr, au
if attr == false
self.errors.add :base, I18n.t('errors.invalid_json')
{:src => self.url, :width => tw, :height => th, :alt => self.caption}
end
+ def new_index
+ @new_index
+ end
+
+ def new_index= v
+ @new_index = v
+ end
+
def new_panel
@new_panel
end
'panel_picture'
end
+ def tag_new_index
+ self.new_index.to_s
+ end
+
def self.default_page_size
25
end
'speech'
end
- def field_tree f
- 'panels-' + self.tag_panel_id + '-speech_balloons_attributes-' + self.tag_element_id + '-speech_attributes-' + f.to_s
+ def tag_new_index
+ if self.get_speech_balloon == nil
+ nil
+ else
+ self.get_speech_balloon.tag_new_index
+ end
end
def self.default_page_size
self.panel.visible? roles
end
+ def new_index
+ @new_index
+ end
+
+ def new_index= v
+ @new_index = v
+ end
+
def new_panel
@new_panel
end
'speech_balloon'
end
+ def tag_new_index
+ self.new_index.to_s
+ end
+
def self.default_page_size
25
end
<div class="field">
<%= f.label :caption %>
- <%= f.text_field :caption, :id => ground_color.field_tag_id(:caption), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :caption %>
+ <%= f.text_field :caption, :id => ground_color.field_tag_id(:caption), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :caption, :no_attr => no_attr %>
</div>
<div class="field">
<%= f.label :code %>
- <%= f.text_field :code, :size => 8, :id => ground_color.tag_id(:code), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :code %>
+ <%= f.text_field :code, :size => 8, :id => ground_color.tag_id(:code), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :code, :no_attr => no_attr %>
<div class="colorpicker-wrap">
<div class="colorpicker" style="float: left;" id="<%= ground_color.tag_id(:code_picker) -%>" panel_id="<%= ground_color.tag_panel_id -%>" element_id="<%= ground_color.tag_element_id -%>" element_type="<%= ground_color.tag_element_type -%>">
<div id="<%= ground_color.tag_id(:code_red) -%>" class="colorpicker-red"></div>
</div>
<div class="field">
<%= f.label :z %>
- <%= f.number_field :z, :size => 5, :id => ground_color.field_tag_id(:z), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :z %>
+ <%= f.number_field :z, :size => 5, :id => ground_color.field_tag_id(:z), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :z, :no_attr => no_attr %>
<%= f.label :t %>
- <%= f.number_field :t, :size => 5, :id => ground_color.field_tag_id(:t), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :t %>
+ <%= f.number_field :t, :size => 5, :id => ground_color.field_tag_id(:t), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :t, :no_attr => no_attr %>
</div>
- <%= f.hidden_field :panel_id, :id => ground_color.field_tag_id(:panel_id), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :panel_id %>
+ <%= f.hidden_field :panel_id, :id => ground_color.field_tag_id(:panel_id), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :panel_id, :no_attr => no_attr %>
<% unless ground_color.new_record? %>
- <%= f.hidden_field :id, :id => ground_color.field_tag_id(:id), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :id %>
+ <%= f.hidden_field :id, :id => ground_color.field_tag_id(:id), :panel_id => ground_color.tag_panel_id, :element_id => ground_color.tag_element_id, :element_type => ground_color.tag_element_type, :column => :id, :no_attr => no_attr %>
<% end %>
<div class="actions">
-<div id="<%= elm.tag_id(:div) -%>" panel_id="<%= elm.tag_panel_id -%>" element_id="<%= elm.tag_element_id -%>" element_type="<%= elm.tag_element_type -%>" class="pettanr-panel-picture-wrapper" style="<%= elm.opt_div_style() -%>">
+<div id="<%= elm.tag_id(:div) -%>" panel_id="<%= elm.tag_panel_id -%>" element_id="<%= elm.tag_element_id -%>" element_type="<%= elm.tag_element_type -%>" new_index="<%= elm.new_index -%>" class="pettanr-panel-picture-wrapper" style="<%= elm.opt_div_style() -%>">
<%= link_to_unless(elm.link.blank?, tag(:img, elm.opt_img_tag(spot)), elm.link) %>
</div>
<div class="field">
<%= f.label :caption %>
- <%= f.text_field :caption, :id => panel_picture.field_tag_id(:caption), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :caption %>
+ <%= f.text_field :caption, :id => panel_picture.field_tag_id(:caption), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :caption, :new_index => panel_picture.new_index %>
</div>
<div class="field">
<%= f.label :x %>
- <%= f.number_field :x, :size => 5, :id => panel_picture.field_tag_id(:x), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :x %>
+ <%= f.number_field :x, :size => 5, :id => panel_picture.field_tag_id(:x), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :x, :new_index => panel_picture.new_index %>
<%= f.label :y %>
- <%= f.number_field :y, :size => 5, :id => panel_picture.field_tag_id(:y), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :y %>
+ <%= f.number_field :y, :size => 5, :id => panel_picture.field_tag_id(:y), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :y, :new_index => panel_picture.new_index %>
</div>
<div class="field">
<%= f.label :z %>
- <%= f.number_field :z, :size => 5, :id => panel_picture.field_tag_id(:z), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :z %>
+ <%= f.number_field :z, :size => 5, :id => panel_picture.field_tag_id(:z), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :z, :new_index => panel_picture.new_index %>
<%= f.label :t %>
- <%= f.number_field :t, :size => 5, :id => panel_picture.field_tag_id(:t), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :t %>
+ <%= f.number_field :t, :size => 5, :id => panel_picture.field_tag_id(:t), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :t, :new_index => panel_picture.new_index %>
</div>
<div class="field">
<%= f.label :width %>
- <%= f.number_field :width, :size => 5, :id => panel_picture.field_tag_id(:width), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :width %>
+ <%= f.number_field :width, :size => 5, :id => panel_picture.field_tag_id(:width), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :width, :new_index => panel_picture.new_index %>
<%= content_tag :span, '', :class => "panel_picture_width_tool", :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type %>
</div>
<div class="field">
<%= f.label :height %>
- <%= f.number_field :height, :size => 5, :id => panel_picture.field_tag_id(:height), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :height %>
+ <%= f.number_field :height, :size => 5, :id => panel_picture.field_tag_id(:height), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :height, :new_index => panel_picture.new_index %>
<%= content_tag :span, '', :class => "panel_picture_height_tool", :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type %>
</div>
<div class="field">
<%= f.label :link %>
- <%= f.text_field :link, :id => panel_picture.field_tag_id(:link), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :link %>
+ <%= f.text_field :link, :id => panel_picture.field_tag_id(:link), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :link, :new_index => panel_picture.new_index %>
</div>
- <%= f.hidden_field :panel_id, :id => panel_picture.field_tag_id(:panel_id), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :panel_id %>
- <%= f.hidden_field :picture_id, :id => panel_picture.field_tag_id(:picture_id), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :picture_id %>
+ <%= f.hidden_field :panel_id, :id => panel_picture.field_tag_id(:panel_id), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :panel_id, :new_index => panel_picture.new_index %>
+ <%= f.hidden_field :picture_id, :id => panel_picture.field_tag_id(:picture_id), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :picture_id, :new_index => panel_picture.new_index %>
<% unless panel_picture.new_record? %>
<%= f.hidden_field :id, :id => panel_picture.field_tag_id(:id), :panel_id => panel_picture.tag_panel_id, :element_id => panel_picture.tag_element_id, :element_type => panel_picture.tag_element_type, :column => :id %>
<% end %>
<div id="elements-tabs-<%= elm.t -%>">
<% case elm.class.to_s %>
<% when 'PanelPicture' %>
- <%= render 'panel_pictures/form', :panel_picture => elm %>
+ <%= render 'panel_pictures/form', :panel_picture => elm, :no_attr => 0 %>
<% when 'SpeechBalloon' %>
<%
speech_balloon = elm
balloon_extend = balloon.extend_balloon
speech_extend = speech.extend_speech
%>
- <%= render elm.speech_balloon_template.engine_name + '/speech_balloons/form', :speech_balloon => speech_balloon, :balloon => balloon, :speech => speech, :speech_balloon_extend => speech_balloon_extend, :balloon_extend => balloon_extend, :speech_extend => speech_extend %>
+ <%= render elm.speech_balloon_template.engine_name + '/speech_balloons/form', :speech_balloon => speech_balloon, :balloon => balloon, :speech => speech, :speech_balloon_extend => speech_balloon_extend, :balloon_extend => balloon_extend, :speech_extend => speech_extend, :no_attr => 0 %>
<% when 'GroundPicture' %>
- <%= render 'ground_pictures/form', :ground_picture => elm %>
+ <%= render 'ground_pictures/form', :ground_picture => elm, :no_attr => 0 %>
<% when 'GroundColor' %>
- <%= render 'ground_colors/form', :ground_color => elm %>
+ <%= render 'ground_colors/form', :ground_color => elm, :no_attr => 0 %>
<% end %>
<%= hidden_field_tag '_destroy', '', :id => elm.field_tag_id(:_destroy), :panel_id => elm.tag_panel_id, :element_id => elm.tag_element_id, :element_type => elm.tag_element_type, :column => :_destroy %>
</div>
balloon.supply_default
speech.supply_default
%>
- <%= render elm.speech_balloon_template.engine_name + '/speech_balloons/form', :speech_balloon => speech_balloon, :balloon => balloon, :speech => speech, :speech_balloon_extend => speech_balloon_extend, :balloon_extend => balloon_extend, :speech_extend => speech_extend %>
+ <%= render elm.speech_balloon_template.engine_name + '/speech_balloons/form', :speech_balloon => speech_balloon, :balloon => balloon, :speech => speech, :speech_balloon_extend => speech_balloon_extend, :balloon_extend => balloon_extend, :speech_extend => speech_extend, :no_attr => 1 %>
</div>
<% end %>
<% when 'GroundPicture' %>
<% when 'GroundColor' %>
<% elm = GroundColor.new :panel_id => @panel.id %>
<% elm.supply_default %>
- <%= render k.to_s.tableize + '/form', :ground_color => elm %>
+ <%= render k.to_s.tableize + '/form', :ground_color => elm, :no_attr => 1 %>
<% end %>
</div>
</div>
@license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
@speech_balloon_template = FactoryGirl.create :speech_balloon_template
+ @writing_format = FactoryGirl.create :writing_format
@panel = FactoryGirl.create :panel, :author_id => @author.id
end
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
sign_in @user
Balloon.stub(:list).and_return([@balloon, @balloon, @balloon])
end
sign_in @user
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
Balloon.stub(:show).and_return(@balloon)
end
context 'つつがなく終わるとき' do
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
sign_in @user
Balloon.stub(:list).and_return([@balloon, @balloon, @balloon])
end
sign_in @user
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
Balloon.stub(:show).and_return(@balloon)
end
context 'つつがなく終わるとき' do
@lg = FactoryGirl.create :license_group
@license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
@speech_balloon_template = FactoryGirl.create :speech_balloon_template
+ @writing_format = FactoryGirl.create :writing_format
@user = FactoryGirl.create( :user_yas)
@author = FactoryGirl.create :author, :user_id => @user.id
@artist = FactoryGirl.create :artist_yas, :author_id => @author.id
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
sign_in @user
SpeechBalloon.stub(:mylist).and_return([@sb, @sb, @sb])
end
@license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
@speech_balloon_template = FactoryGirl.create :speech_balloon_template
+ @writing_format = FactoryGirl.create :writing_format
@panel = FactoryGirl.create :panel, :author_id => @author.id
end
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
sign_in @user
Speech.stub(:list).and_return([@speech, @speech, @speech])
end
sign_in @user
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
Speech.stub(:show).and_return(@speech)
end
context 'つつがなく終わるとき' do
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
sign_in @user
Speech.stub(:list).and_return([@speech, @speech, @speech])
end
sign_in @user
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
Speech.stub(:show).and_return(@speech)
end
context 'つつがなく終わるとき' do
license.system_picture_id 1
end
+ factory :writing_format, :class => WritingFormat do |writing_format|
+ writing_format.name 'simple_format@pettan.com'
+ writing_format.classname 'SimpleFormat'
+ writing_format.caption 'sl'
+ writing_format.system_picture_id 1
+ writing_format.settings '{}'
+ end
+
factory :comic, :class => Comic do |comic|
comic.title "comic"
comic.description 'comic description'
factory :speech, :class => Speech do |speech|
speech.speech_balloon_id 1
+ speech.writing_format_id 1
speech.content 'test'
speech.x 10
speech.y 100
@license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id\r
\r
@speech_balloon_template = FactoryGirl.create :speech_balloon_template\r
+ @writing_format = FactoryGirl.create :writing_format\r
@panel = FactoryGirl.create :panel, :author_id => @author.id\r
end\r
\r
describe '検証に於いて' do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
@balloon = FactoryGirl.build :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
end\r
context 'オーソドックスなデータのとき' do\r
describe '文字コード検証に於いて' do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
@balloon = FactoryGirl.build :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
end\r
\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
context 'オープンモードのとき' do\r
before do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
context 'page補正について' do\r
it '文字列から数値に変換される' do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
it 'フキダシを含んでいる' do\r
r = Balloon.list.to_json Balloon.list_json_opt\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
context 'つつがなく終わるとき' do\r
it '単体取得オプションを利用している' do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
it 'フキダシを含んでいる' do\r
r = Balloon.show(@balloon.id, @author).to_json Balloon.show_json_opt\r
@sp = FactoryGirl.create :system_picture\r
@lg = FactoryGirl.create :license_group\r
@license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id\r
+ @writing_format = FactoryGirl.create :writing_format\r
@user = FactoryGirl.create( :user_yas)\r
@author = FactoryGirl.create :author, :user_id => @user.id\r
@artist = FactoryGirl.create :artist_yas, :author_id => @author.id\r
FactoryGirl.attributes_for(:balloon, :speech_balloon_id => @sb.id)\r
)\r
@sb.create_speech(\r
- FactoryGirl.attributes_for(:speech, :speech_balloon_id => @sb.id)\r
+ FactoryGirl.attributes_for(:speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id)\r
)\r
@gc = @panel.ground_colors.create(\r
FactoryGirl.attributes_for(:ground_color, :panel_id => @panel.id, :t => 2)\r
@license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id
@panel = FactoryGirl.create :panel, :author_id => @author.id
+ @writing_format = FactoryGirl.create :writing_format
@speech_balloon_template = FactoryGirl.create :speech_balloon_template
end
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
end
context 'page補正について' do
it '文字列から数値に変換される' do
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
end
context 'つつがなく終わるとき' do
it '一覧取得オプションを利用している' do
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
@other_panel = FactoryGirl.create :panel, :author_id => @other_author.id, :publish => 1
@other_sb = FactoryGirl.create :speech_balloon, :panel_id => @other_panel.id, :speech_balloon_template_id => @speech_balloon_template.id
end
@panel = FactoryGirl.create :panel, :author_id => @author.id, :publish => 1
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
end
it 'コマを含んでいる' do
r = SpeechBalloon.list.to_json SpeechBalloon.list_json_opt
before do
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
end
context 'つつがなく終わるとき' do
it '単体取得オプションを利用している' do
@panel = FactoryGirl.create :panel, :author_id => @author.id, :publish => 1
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id
end
it 'コマを含んでいる' do
r = SpeechBalloon.show(@sb.id, @author).to_json SpeechBalloon.show_json_opt
@lg = FactoryGirl.create :license_group\r
@license = FactoryGirl.create :license, :license_group_id => @lg.id, :system_picture_id => @sp.id\r
\r
+ @writing_format = FactoryGirl.create :writing_format\r
@speech_balloon_template = FactoryGirl.create :speech_balloon_template\r
@panel = FactoryGirl.create :panel, :author_id => @author.id\r
end\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.build :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.build :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
\r
context 'オーソドックスなデータのとき' do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.build :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.build :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
\r
context 'contentを検証するとき' do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
context 'オープンモードのとき' do\r
before do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
context 'page補正について' do\r
it '文字列から数値に変換される' do\r
end\r
context 'DBに5件あって1ページの件数を2件に変えたとして' do\r
before do\r
- @speech2 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :updated_at => Time.now + 100\r
- @speech3 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :updated_at => Time.now + 200\r
- @speech4 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :updated_at => Time.now + 300\r
- @speech5 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :updated_at => Time.now + 400\r
+ @speech2 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id, :updated_at => Time.now + 100\r
+ @speech3 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id, :updated_at => Time.now + 200\r
+ @speech4 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id, :updated_at => Time.now + 300\r
+ @speech5 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id, :updated_at => Time.now + 400\r
Speech.stub(:default_page_size).and_return(2)\r
end\r
it '通常は2件を返す' do\r
end\r
context 'DBに5件あって1ページの件数を0件に変えたとして' do\r
before do\r
- @speech2 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :updated_at => Time.now + 100\r
- @speech3 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :updated_at => Time.now + 200\r
- @speech4 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :updated_at => Time.now + 300\r
- @speech5 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :updated_at => Time.now + 400\r
+ @speech2 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id, :updated_at => Time.now + 100\r
+ @speech3 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id, :updated_at => Time.now + 200\r
+ @speech4 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id, :updated_at => Time.now + 300\r
+ @speech5 = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id, :updated_at => Time.now + 400\r
Speech.stub(:default_page_size).and_return(2)\r
end\r
it '通常は全件(5件)を返す' do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
it 'フキダシを含んでいる' do\r
r = Speech.list.to_json Speech.list_json_opt\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
context 'つつがなく終わるとき' do\r
it '単体取得オプションを利用している' do\r
before do\r
@sb = FactoryGirl.create :speech_balloon, :panel_id => @panel.id, :speech_balloon_template_id => @speech_balloon_template.id\r
@balloon = FactoryGirl.create :balloon, :speech_balloon_id => @sb.id, :system_picture_id => @sp.id\r
- @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id\r
+ @speech = FactoryGirl.create :speech, :speech_balloon_id => @sb.id, :writing_format_id => @writing_format.id\r
end\r
it 'フキダシを含んでいる' do\r
r = Speech.show(@speech.id, @author).to_json Speech.show_json_opt\r