count: {\r
type: 'count',\r
args: {\r
- list_name: 'public',\r
+ list_name: 'private',\r
},\r
},\r
new: {\r
number: true,\r
}\r
},\r
- license_group_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
license_group_settings: {\r
type: 'text',\r
rules : {\r
"count": {\r
"type": "count",\r
"args": {\r
- "list_name": "public"\r
+ "list_name": "private"\r
}\r
},\r
"new": {\r
end\r
\r
describe 'ペタナイズに於いて' do\r
- it 'ã\82¹ã\82¯ã\82³ã\83\9eã\82\92é\96\89ã\81\98ã\82\8bã\81\9fã\82\81ã\81®ã\83\90ã\82¤ã\83³ã\83\80ã\83¼である' do\r
- expect(@model.ancestors.include?(Peta::Binder)).to eq true\r
+ it 'ã\83\95ã\82ã\83\80ã\82·ã\81®è¦\81ç´ ã\81¨ã\81\97ã\81¦å\88©ç\94¨ã\81\95ã\82\8cã\82\8bã\82¨ã\83¬ã\83¡ã\83³ã\83\88である' do\r
+ expect(@model.ancestors.include?(Peta::Element)).to eq true\r
end\r
- it '親モデルは持たない' do\r
- expect(@model.my_peta.parent_model_name).to be_blank\r
+ it '親モデルはフキダシである' do\r
+ expect(@model.my_peta.parent_model_name).to eq 'speech_balloon'\r
end\r
describe 'ブーストに於いて' do\r
- it '特筆すべき注意事項はない' do\r
- expect(@model.my_peta.boost.keys).to be_empty\r
+ before do\r
+ @boosts = @model.my_peta.boost\r
+ @boosts_names = ['speech_balloon_template']\r
+ end\r
+ it 'これらのブーストが定義されている' do\r
+ set_boosts? @boosts, @boosts_names\r
+ end\r
+ describe 'フキダシテンプレートに於いて' do\r
+ before do\r
+ @mani = @boosts['speech_balloon_template']\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.level).to eq 'post'\r
+ expect(@mani.template_name).to eq 'speech_balloon_template'\r
+ expect(@mani.column_name_for_template_module).to eq 'speech_balloon_template_module_name'\r
+ expect(@mani.settings_column_name).to eq 'speech_balloon_template_settings'\r
+ expect(@mani.foreign_key).to eq 'speech_balloon_template_id'\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.item_name_for_extend_model).to eq 'balloon'\r
+ expect(@mani.setter_method_name).to eq 'balloon_extend='\r
+ expect(@mani.getter_method_name).to eq 'balloon_extend'\r
+ expect(@mani.extend_model_class_name).to eq 'Balloon'\r
+ expect(@mani.extend_module_name).to eq 'BalloonModule'\r
+ end\r
end\r
end\r
\r
before do\r
@controller = @model.my_controller\r
end\r
- it 'ã\82¹ã\82¯ã\83ã\83¼ã\83«のためのコントローラである' do\r
- expect(@model.item_name).to eq 'scroll'\r
+ it 'ã\83\95ã\82ã\83\80ã\82·æ\9e のためのコントローラである' do\r
+ expect(@model.item_name).to eq 'balloon'\r
end\r
describe 'actionに於いて' do\r
before do\r
@actions = @controller.actions\r
- @actions_names = ['index', 'by_author', 'by_panel', 'play', 'show', \r
- 'count', 'count_by_author', 'count_by_panel', \r
- 'new', 'edit', 'create', 'update', 'destroy']\r
+ @actions_names = ['index', 'by_author', 'show', \r
+ 'count', 'count_by_author', \r
+ 'new', 'edit']\r
end\r
it 'これらのアクションが定義されている' do\r
set_actions? @actions, @actions_names\r
expect(@action.type).to eq 'list'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # ã\82¹ã\82¯ã\83ã\83¼ã\83«の公開リストを返すように定義している\r
- set_list_action? @action, 'scroll', 'public'\r
+ # ã\83\95ã\82ã\83\80ã\82·æ\9e の公開リストを返すように定義している\r
+ set_list_action? @action, 'balloon', 'public'\r
end\r
end\r
describe 'by_authorに於いて' do\r
expect(@action.type).to eq 'list'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # スクロールの作家フィルタリストを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_author'\r
- end\r
- end\r
- describe 'by_panelに於いて' do\r
- before do\r
- @action = @actions['by_panel']\r
- end\r
- it 'listタイプのアクションである' do\r
- expect(@action.type).to eq 'list'\r
- end\r
- it 'マニフェストから設定を取り出している' do\r
- #スクロールのコマフィルタリストを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_panel'\r
+ # フキダシ枠の作家フィルタリストを返すように定義している\r
+ set_list_action? @action, 'balloon', 'by_author'\r
end\r
end\r
describe 'countに於いて' do\r
expect(@action.type).to eq 'count'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- #ã\82¹ã\82¯ã\83ã\83¼ã\83«の公開リストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'public'\r
+ #ã\83\95ã\82ã\83\80ã\82·æ\9e の公開リストのカウントを返すように定義している\r
+ set_list_action? @action, 'balloon', 'public'\r
end\r
end\r
describe 'count_by_authorに於いて' do\r
expect(@action.type).to eq 'count'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # スクロールの作家フィルタリストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_author'\r
- end\r
- end\r
- describe 'count_by_panelに於いて' do\r
- before do\r
- @action = @actions['count_by_panel']\r
- end\r
- it 'countタイプのアクションである' do\r
- expect(@action.type).to eq 'count'\r
- end\r
- it 'マニフェストから設定を取り出している' do\r
- # スクロールのコマフィルタリストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_panel'\r
+ # フキダシ枠の作家フィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'balloon', 'by_author'\r
end\r
end\r
describe 'newに於いて' do\r
expect(@action.type).to eq 'new'\r
end\r
it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ expect(@action.item_name).to eq 'balloon'\r
end\r
end\r
describe 'editに於いて' do\r
expect(@action.type).to eq 'edit'\r
end\r
it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
- end\r
- end\r
- describe 'createに於いて' do\r
- before do\r
- @action = @actions['create']\r
- end\r
- it 'createタイプのアクションである' do\r
- expect(@action.type).to eq 'create'\r
- end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
- end\r
- end\r
- describe 'updateに於いて' do\r
- before do\r
- @action = @actions['update']\r
- end\r
- it 'updateタイプのアクションである' do\r
- expect(@action.type).to eq 'update'\r
- end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
- end\r
- end\r
- describe 'destroyに於いて' do\r
- before do\r
- @action = @actions['destroy']\r
- end\r
- it 'destroyタイプのアクションである' do\r
- expect(@action.type).to eq 'destroy'\r
- end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ expect(@action.item_name).to eq 'balloon'\r
end\r
end\r
end\r
@my_manifest = @model.my_manifest\r
end\r
it 'サポート機能が動作している' do\r
- expect(@my_manifest.model_name).to eq 'scroll'\r
+ expect(@my_manifest.model_name).to eq 'balloon'\r
expect(@my_manifest.classify).to eq @model\r
- expect(@my_manifest.table_name).to eq 'scrolls'\r
+ expect(@my_manifest.table_name).to eq 'balloons'\r
end\r
\r
describe 'associationsに於いて' do\r
describe 'belongs_toに於いて' do\r
before do\r
@belongs_to = @my_manifest.associations.belongs_to\r
- @names = ['author']\r
+ @names = ['speech_balloon', 'system_picture', 'speech_balloon_template']\r
end\r
it 'これらのモデルに所属している' do\r
set_associations? @belongs_to, @names\r
end\r
- describe 'authorに於いて' do\r
+ describe 'speech_balloonに於いて' do\r
before do\r
- @mani = @belongs_to['author']\r
+ @mani = @belongs_to['speech_balloon']\r
end\r
it 'マニフェストから設定を取り出している' do\r
# モデル名と外部キーが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'author'\r
- expect(@mani.id_column).to eq 'author_id'\r
+ expect(@mani.model_name).to eq 'speech_balloon'\r
+ expect(@mani.id_column).to eq 'speech_balloon_id'\r
end\r
it 'サポート機能が動作している' do\r
# モデルを再現できている\r
- expect(@mani.model).to eq Author\r
+ expect(@mani.model).to eq SpeechBalloon\r
end\r
end\r
- end\r
- describe 'has_manyに於いて' do\r
- before do\r
- @has_many = @model.my_manifest.associations.has_many\r
- @names = ['scroll_panels', 'panels']\r
- end\r
- it 'これらのモデルを所持している' do\r
- set_associations? @has_many, @names\r
- end\r
- describe 'scroll_panelsに於いて' do\r
+ describe 'system_pictureに於いて' do\r
before do\r
- @mani = @has_many['scroll_panels']\r
+ @mani = @belongs_to['system_picture']\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'scroll_panel'\r
- expect(@mani.foreign_key).to eq 'scroll_id'\r
- expect(@mani.through).to be nil\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'system_picture'\r
+ expect(@mani.id_column).to eq 'system_picture_id'\r
end\r
it 'サポート機能が動作している' do\r
- # モデルを再現できている, 中間モデルフラグ\r
- expect(@mani.through?).to be false\r
- expect(@mani.model).to eq ScrollPanel\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq SystemPicture\r
end\r
end\r
- describe 'panelsに於いて' do\r
+ describe 'speech_balloon_templateに於いて' do\r
before do\r
- @mani = @has_many['panels']\r
+ @mani = @belongs_to['speech_balloon_template']\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'panel'\r
- expect(@mani.foreign_key).to eq 'scroll_id'\r
- expect(@mani.through).to eq 'scroll_panels'\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'speech_balloon_template'\r
+ expect(@mani.id_column).to eq 'speech_balloon_template_id'\r
end\r
it 'サポート機能が動作している' do\r
- # モデルを再現できている, 中間モデルフラグ\r
- expect(@mani.through?).to be true\r
- expect(@mani.model).to eq Panel\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq SpeechBalloonTemplate\r
end\r
end\r
end\r
+ describe 'has_manyに於いて' do\r
+ before do\r
+ @has_many = @model.my_manifest.associations.has_many\r
+ @names = []\r
+ end\r
+ it 'これらのモデルを所持している' do\r
+ set_associations? @has_many, @names\r
+ end\r
+ end\r
end\r
\r
describe 'attributesに於いて' do\r
end\r
it 'これらのカラムを定義している' do\r
set_attributes? @attributes, \r
- ['id', 'title', 'description', 'visible', 'author_id', \r
+ ['id', 'speech_balloon_id', 'speech_balloon_template_id', 'speech_balloon_template_module_name', \r
+ 'system_picture_id', 'x', 'y', 'width', 'height', 'r', \r
+ 'speech_balloon_template_settings', \r
'created_at', 'updated_at']\r
end\r
- describe 'titleに於いて' do\r
+ describe 'speech_balloon_idに於いて' do\r
before do\r
- @attribute = @attributes['title']\r
+ @attribute = @attributes['speech_balloon_id']\r
end\r
- it 'textタイプである' do\r
- expect(@attribute.type).to eq 'text'\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'speech_balloon_template_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['speech_balloon_template_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
end\r
end\r
- describe 'descriptionに於いて' do\r
+ describe 'speech_balloon_template_module_nameに於いて' do\r
before do\r
- @attribute = @attributes['description']\r
+ @attribute = @attributes['speech_balloon_template_module_name']\r
end\r
it 'textタイプである' do\r
expect(@attribute.type).to eq 'text'\r
end\r
end\r
- describe 'visibleに於いて' do\r
+ describe 'system_picture_idに於いて' do\r
before do\r
- @attribute = @attributes['visible']\r
+ @attribute = @attributes['system_picture_id']\r
end\r
it 'numberタイプである' do\r
expect(@attribute.type).to eq 'number'\r
end\r
- it '選択肢を定数から取得できるように定義している' do\r
- expect(@attribute.source.type).to eq 'magic_number'\r
- expect(@attribute.source.select_item_name).to eq 'scroll_visible_items'\r
+ end\r
+ describe 'xに於いて' do\r
+ before do\r
+ @attribute = @attributes['x']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
end\r
end\r
- describe 'author_idに於いて' do\r
+ describe 'yに於いて' do\r
before do\r
- @attribute = @attributes['author_id']\r
+ @attribute = @attributes['y']\r
end\r
it 'numberタイプである' do\r
expect(@attribute.type).to eq 'number'\r
end\r
end\r
+ describe 'widthに於いて' do\r
+ before do\r
+ @attribute = @attributes['width']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'heightに於いて' do\r
+ before do\r
+ @attribute = @attributes['height']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'rに於いて' do\r
+ before do\r
+ @attribute = @attributes['r']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'speech_balloon_template_settingsに於いて' do\r
+ before do\r
+ @attribute = @attributes['speech_balloon_template_settings']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
end\r
\r
end\r
end
describe 'ペタナイズに於いて' do
- it 'スクコマを閉じるためのバインダーである' do
- expect(@model.ancestors.include?(Peta::Binder)).to eq true
+ it '絵師が投稿するコンテンツである' do
+ expect(@model.ancestors.include?(Peta::Content)).to eq true
end
it '親モデルは持たない' do
expect(@model.my_peta.parent_model_name).to be_blank
before do
@controller = @model.my_controller
end
- it 'スクロールのためのコントローラである' do
- expect(@model.item_name).to eq 'scroll'
+ it '原画のためのコントローラである' do
+ expect(@model.item_name).to eq 'original_picture'
end
describe 'actionに於いて' do
before do
@actions = @controller.actions
- @actions_names = ['index', 'by_author', 'by_panel', 'play', 'show',
- 'count', 'count_by_author', 'count_by_panel',
+ @actions_names = ['index', 'history', 'show',
+ 'count',
'new', 'edit', 'create', 'update', 'destroy']
end
it 'これらのアクションが定義されている' do
expect(@action.type).to eq 'list'
end
it 'マニフェストから設定を取り出している' do
- # スクロールの公開リストを返すように定義している
- set_list_action? @action, 'scroll', 'public'
+ # オーナーしか操作できないアイテムなので、
+ # 不特定多数のユーザで共有する必要がない。
+ # よって、 privateリスト(自分の原画リスト)に割り当てる。
+ set_list_action? @action, 'original_picture', 'private'
end
end
- describe 'by_authorに於いて' do
+ describe 'historyに於いて' do
before do
- @action = @actions['by_author']
+ @action = @actions['history']
end
- it 'listタイプのアクションである' do
- expect(@action.type).to eq 'list'
- end
- it 'マニフェストから設定を取り出している' do
- # スクロールの作家フィルタリストを返すように定義している
- set_list_action? @action, 'scroll', 'by_author'
+ # 投稿履歴を一覧するための機能。
+ # 一覧そのものは実素材の原画フィルタで見られるが、
+ # 過去の実素材を他人が見る事はできないので、
+ # オーナーであることが保証される原画にこの機能を備えてある。
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
end
end
- describe 'by_panelに於いて' do
+ describe 'showに於いて' do
before do
- @action = @actions['by_panel']
+ @action = @actions['show']
end
- it 'listタイプのアクションである' do
- expect(@action.type).to eq 'list'
- end
- it 'マニフェストから設定を取り出している' do
- #スクロールのコマフィルタリストを返すように定義している
- set_list_action? @action, 'scroll', 'by_panel'
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
end
end
describe 'countに於いて' do
expect(@action.type).to eq 'count'
end
it 'マニフェストから設定を取り出している' do
- #スクロールの公開リストのカウントを返すように定義している
- set_list_action? @action, 'scroll', 'public'
- end
- end
- describe 'count_by_authorに於いて' do
- before do
- @action = @actions['count_by_author']
- end
- it 'countタイプのアクションである' do
- expect(@action.type).to eq 'count'
- end
- it 'マニフェストから設定を取り出している' do
- # スクロールの作家フィルタリストのカウントを返すように定義している
- set_list_action? @action, 'scroll', 'by_author'
- end
- end
- describe 'count_by_panelに於いて' do
- before do
- @action = @actions['count_by_panel']
- end
- it 'countタイプのアクションである' do
- expect(@action.type).to eq 'count'
- end
- it 'マニフェストから設定を取り出している' do
- # スクロールのコマフィルタリストのカウントを返すように定義している
- set_list_action? @action, 'scroll', 'by_panel'
+ # indexがprivateリストなので、当然件数取得もprivateリストの総数を返す。
+ set_list_action? @action, 'original_picture', 'private'
end
end
describe 'newに於いて' do
expect(@action.type).to eq 'new'
end
it 'type' do
- expect(@action.item_name).to eq 'scroll'
+ expect(@action.item_name).to eq 'original_picture'
end
end
describe 'editに於いて' do
expect(@action.type).to eq 'edit'
end
it 'type' do
- expect(@action.item_name).to eq 'scroll'
+ expect(@action.item_name).to eq 'original_picture'
end
end
describe 'createに於いて' do
expect(@action.type).to eq 'create'
end
it 'type' do
- expect(@action.item_name).to eq 'scroll'
+ expect(@action.item_name).to eq 'original_picture'
end
end
describe 'updateに於いて' do
expect(@action.type).to eq 'update'
end
it 'type' do
- expect(@action.item_name).to eq 'scroll'
+ expect(@action.item_name).to eq 'original_picture'
end
end
describe 'destroyに於いて' do
expect(@action.type).to eq 'destroy'
end
it 'type' do
- expect(@action.item_name).to eq 'scroll'
+ expect(@action.item_name).to eq 'original_picture'
end
end
end
@my_manifest = @model.my_manifest
end
it 'サポート機能が動作している' do
- expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.model_name).to eq 'original_picture'
expect(@my_manifest.classify).to eq @model
- expect(@my_manifest.table_name).to eq 'scrolls'
+ expect(@my_manifest.table_name).to eq 'original_pictures'
end
describe 'associationsに於いて' do
describe 'belongs_toに於いて' do
before do
@belongs_to = @my_manifest.associations.belongs_to
- @names = ['author']
+ @names = ['artist']
end
it 'これらのモデルに所属している' do
set_associations? @belongs_to, @names
end
- describe 'authorに於いて' do
+ describe 'artistに於いて' do
before do
- @mani = @belongs_to['author']
+ @mani = @belongs_to['artist']
end
it 'マニフェストから設定を取り出している' do
# モデル名と外部キーが定義あるいはデフォルト値補充されている
- expect(@mani.model_name).to eq 'author'
- expect(@mani.id_column).to eq 'author_id'
+ expect(@mani.model_name).to eq 'artist'
+ expect(@mani.id_column).to eq 'artist_id'
end
it 'サポート機能が動作している' do
# モデルを再現できている
- expect(@mani.model).to eq Author
+ expect(@mani.model).to eq Artist
end
end
end
describe 'has_manyに於いて' do
before do
@has_many = @model.my_manifest.associations.has_many
- @names = ['scroll_panels', 'panels']
+ @names = ['pictures']
end
it 'これらのモデルを所持している' do
set_associations? @has_many, @names
end
- describe 'scroll_panelsに於いて' do
+ describe 'picturesに於いて' do
before do
- @mani = @has_many['scroll_panels']
+ @mani = @has_many['pictures']
end
it 'マニフェストから設定を取り出している' do
# モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
- expect(@mani.model_name).to eq 'scroll_panel'
- expect(@mani.foreign_key).to eq 'scroll_id'
+ expect(@mani.model_name).to eq 'picture'
+ expect(@mani.foreign_key).to eq 'original_picture_id'
expect(@mani.through).to be nil
end
it 'サポート機能が動作している' do
# モデルを再現できている, 中間モデルフラグ
expect(@mani.through?).to be false
- expect(@mani.model).to eq ScrollPanel
+ expect(@mani.model).to eq Picture
end
end
- describe 'panelsに於いて' do
+ end
+ describe 'has_oneに於いて' do
+ before do
+ @has_one = @model.my_manifest.associations.has_one
+ @names = ['resource_picture']
+ end
+ it 'これらのモデルを所持している' do
+ set_associations? @has_one, @names
+ end
+ describe 'resource_pictureに於いて' do
before do
- @mani = @has_many['panels']
+ @mani = @has_one['resource_picture']
end
it 'マニフェストから設定を取り出している' do
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
- expect(@mani.model_name).to eq 'panel'
- expect(@mani.foreign_key).to eq 'scroll_id'
- expect(@mani.through).to eq 'scroll_panels'
+ # モデル名, 外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'resource_picture'
+ expect(@mani.foreign_key).to eq 'original_picture_id'
end
it 'サポート機能が動作している' do
- # モデルを再現できている, 中間モデルフラグ
- expect(@mani.through?).to be true
- expect(@mani.model).to eq Panel
+ # モデルを再現できている
+ expect(@mani.model).to eq ResourcePicture
end
end
end
end
it 'これらのカラムを定義している' do
set_attributes? @attributes,
- ['id', 'title', 'description', 'visible', 'author_id',
+ ['id', 'ext',
+ 'width', 'height', 'filesize', 'artist_id', 'md5',
+ 'uploaded_at', 'published_at', 'stopped_at',
'created_at', 'updated_at']
end
- describe 'titleに於いて' do
+ describe 'extに於いて' do
before do
- @attribute = @attributes['title']
+ @attribute = @attributes['ext']
end
it 'textタイプである' do
expect(@attribute.type).to eq 'text'
end
end
- describe 'descriptionに於いて' do
+ describe 'widthに於いて' do
before do
- @attribute = @attributes['description']
+ @attribute = @attributes['width']
end
- it 'textタイプである' do
- expect(@attribute.type).to eq 'text'
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
end
end
- describe 'visibleに於いて' do
+ describe 'heightに於いて' do
before do
- @attribute = @attributes['visible']
+ @attribute = @attributes['height']
end
it 'numberタイプである' do
expect(@attribute.type).to eq 'number'
end
- it '選択肢を定数から取得できるように定義している' do
- expect(@attribute.source.type).to eq 'magic_number'
- expect(@attribute.source.select_item_name).to eq 'scroll_visible_items'
+ end
+ describe 'filesizeに於いて' do
+ before do
+ @attribute = @attributes['filesize']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
end
end
- describe 'author_idに於いて' do
+ describe 'artist_idに於いて' do
before do
- @attribute = @attributes['author_id']
+ @attribute = @attributes['artist_id']
end
it 'numberタイプである' do
expect(@attribute.type).to eq 'number'
end
end
+ describe 'md5に於いて' do
+ before do
+ @attribute = @attributes['md5']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'uploaded_atに於いて' do
+ before do
+ @attribute = @attributes['uploaded_at']
+ end
+ it 'datetimeタイプである' do
+ expect(@attribute.type).to eq 'datetime'
+ end
+ end
+ describe 'published_atに於いて' do
+ before do
+ @attribute = @attributes['published_at']
+ end
+ it 'datetimeタイプである' do
+ expect(@attribute.type).to eq 'datetime'
+ end
+ end
+ describe 'stopped_atに於いて' do
+ before do
+ @attribute = @attributes['stopped_at']
+ end
+ it 'datetimeタイプである' do
+ expect(@attribute.type).to eq 'datetime'
+ end
+ end
end
end
end
describe 'ペタナイズに於いて' do
- it 'スクコマを閉じるためのバインダーである' do
- expect(@model.ancestors.include?(Peta::Binder)).to eq true
+ it '絵師が投稿するコンテンツである' do
+ expect(@model.ancestors.include?(Peta::Content)).to eq true
end
it '親モデルは持たない' do
expect(@model.my_peta.parent_model_name).to be_blank
end
describe 'ブーストに於いて' do
- it '特筆すべき注意事項はない' do
- expect(@model.my_peta.boost.keys).to be_empty
+ before do
+ @boosts = @model.my_peta.boost
+ @boosts_names = ['license_group', 'license', 'credit_picture']
+ end
+ it 'これらのブーストが定義されている' do
+ set_boosts? @boosts, @boosts_names
+ end
+ describe 'ライセンスグループに於いて' do
+ before do
+ @mani = @boosts['license_group']
+ end
+ it 'フキダシテンプレート' do
+ expect(@mani.level).to eq 'post'
+ expect(@mani.template_name).to eq 'license_group'
+ expect(@mani.column_name_for_template_module).to eq 'license_group_module_name'
+ expect(@mani.settings_column_name).to eq 'license_group_settings'
+ expect(@mani.foreign_key).to eq 'license_group_id'
+ end
+ it 'フキダシテンプレート' do
+ expect(@mani.item_name_for_extend_model).to eq 'license'
+ expect(@mani.setter_method_name).to eq 'license_extend='
+ expect(@mani.getter_method_name).to eq 'license_extend'
+ expect(@mani.extend_model_class_name).to eq 'License'
+ expect(@mani.extend_module_name).to eq 'LicenseModule'
+ end
+ end
+ describe 'ライセンスに於いて' do
+ before do
+ @mani = @boosts['license']
+ end
+ it 'フキダシテンプレート' do
+ expect(@mani.level).to eq 'read'
+ expect(@mani.template_name).to eq 'license_group'
+ expect(@mani.column_name_for_template_module).to eq 'license_group_module_name'
+ expect(@mani.settings_column_name).to eq 'license_settings'
+ expect(@mani.foreign_key).to eq 'license_group_id'
+ end
+ it 'フキダシテンプレート' do
+ expect(@mani.item_name_for_extend_model).to eq 'attribute'
+ expect(@mani.setter_method_name).to eq 'attribute_extend='
+ expect(@mani.getter_method_name).to eq 'attribute_extend'
+ expect(@mani.extend_model_class_name).to eq 'Attribute'
+ expect(@mani.extend_module_name).to eq 'AttributeModule'
+ end
+ end
+ describe 'クレジットに於いて' do
+ before do
+ @mani = @boosts['credit_picture']
+ end
+ it 'フキダシテンプレート' do
+ expect(@mani.level).to eq 'read'
+ expect(@mani.template_name).to eq 'license_group'
+ expect(@mani.column_name_for_template_module).to eq 'license_group_module_name'
+ expect(@mani.settings_column_name).to eq 'credit_picture_settings'
+ expect(@mani.foreign_key).to eq 'license_group_id'
+ end
+ it 'フキダシテンプレート' do
+ expect(@mani.item_name_for_extend_model).to eq 'credit_picture'
+ expect(@mani.setter_method_name).to eq 'credit_picture_extend='
+ expect(@mani.getter_method_name).to eq 'credit_picture_extend'
+ expect(@mani.extend_model_class_name).to eq 'CreditPicture'
+ expect(@mani.extend_module_name).to eq 'CreditPictureModule'
+ end
end
end
before do
@controller = @model.my_controller
end
- it 'スクロールのためのコントローラである' do
- expect(@model.item_name).to eq 'scroll'
+ it '実素材のためのコントローラである' do
+ expect(@model.item_name).to eq 'picture'
end
describe 'actionに於いて' do
before do
@actions = @controller.actions
- @actions_names = ['index', 'by_author', 'by_panel', 'play', 'show',
- 'count', 'count_by_author', 'count_by_panel',
- 'new', 'edit', 'create', 'update', 'destroy']
+ @actions_names = ['index', 'by_artist', 'show',
+ 'count', 'count_by_artist']
end
it 'これらのアクションが定義されている' do
set_actions? @actions, @actions_names
expect(@action.type).to eq 'list'
end
it 'マニフェストから設定を取り出している' do
- # スクロールの公開リストを返すように定義している
- set_list_action? @action, 'scroll', 'public'
+ # 実素材の公開リストを返すように定義している
+ set_list_action? @action, 'picture', 'public'
end
end
- describe 'by_authorに於いて' do
+ describe 'by_artistに於いて' do
before do
- @action = @actions['by_author']
+ @action = @actions['by_artist']
end
it 'listタイプのアクションである' do
expect(@action.type).to eq 'list'
end
it 'マニフェストから設定を取り出している' do
- # スクロールの作家フィルタリストを返すように定義している
- set_list_action? @action, 'scroll', 'by_author'
- end
- end
- describe 'by_panelに於いて' do
- before do
- @action = @actions['by_panel']
- end
- it 'listタイプのアクションである' do
- expect(@action.type).to eq 'list'
- end
- it 'マニフェストから設定を取り出している' do
- #スクロールのコマフィルタリストを返すように定義している
- set_list_action? @action, 'scroll', 'by_panel'
+ # 実素材の絵師フィルタリストを返すように定義している
+ set_list_action? @action, 'picture', 'by_artist'
end
end
describe 'countに於いて' do
expect(@action.type).to eq 'count'
end
it 'マニフェストから設定を取り出している' do
- #スクロールの公開リストのカウントを返すように定義している
- set_list_action? @action, 'scroll', 'public'
+ #実素材の公開リストのカウントを返すように定義している
+ set_list_action? @action, 'picture', 'public'
end
end
- describe 'count_by_authorに於いて' do
+ describe 'showに於いて' do
before do
- @action = @actions['count_by_author']
- end
- it 'countタイプのアクションである' do
- expect(@action.type).to eq 'count'
+ @action = @actions['show']
end
- it 'マニフェストから設定を取り出している' do
- # スクロールの作家フィルタリストのカウントを返すように定義している
- set_list_action? @action, 'scroll', 'by_author'
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
end
end
- describe 'count_by_panelに於いて' do
+ describe 'count_by_artistに於いて' do
before do
- @action = @actions['count_by_panel']
+ @action = @actions['count_by_artist']
end
it 'countタイプのアクションである' do
expect(@action.type).to eq 'count'
end
it 'マニフェストから設定を取り出している' do
- # スクロールのコマフィルタリストのカウントを返すように定義している
- set_list_action? @action, 'scroll', 'by_panel'
- end
- end
- describe 'newに於いて' do
- before do
- @action = @actions['new']
- end
- it 'newタイプのアクションである' do
- expect(@action.type).to eq 'new'
- end
- it 'type' do
- expect(@action.item_name).to eq 'scroll'
- end
- end
- describe 'editに於いて' do
- before do
- @action = @actions['edit']
- end
- it 'editタイプのアクションである' do
- expect(@action.type).to eq 'edit'
- end
- it 'type' do
- expect(@action.item_name).to eq 'scroll'
- end
- end
- describe 'createに於いて' do
- before do
- @action = @actions['create']
- end
- it 'createタイプのアクションである' do
- expect(@action.type).to eq 'create'
- end
- it 'type' do
- expect(@action.item_name).to eq 'scroll'
- end
- end
- describe 'updateに於いて' do
- before do
- @action = @actions['update']
- end
- it 'updateタイプのアクションである' do
- expect(@action.type).to eq 'update'
- end
- it 'type' do
- expect(@action.item_name).to eq 'scroll'
- end
- end
- describe 'destroyに於いて' do
- before do
- @action = @actions['destroy']
- end
- it 'destroyタイプのアクションである' do
- expect(@action.type).to eq 'destroy'
- end
- it 'type' do
- expect(@action.item_name).to eq 'scroll'
+ # 実素材の絵師フィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'picture', 'by_artist'
end
end
end
@my_manifest = @model.my_manifest
end
it 'サポート機能が動作している' do
- expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.model_name).to eq 'picture'
expect(@my_manifest.classify).to eq @model
- expect(@my_manifest.table_name).to eq 'scrolls'
+ expect(@my_manifest.table_name).to eq 'pictures'
end
describe 'associationsに於いて' do
describe 'belongs_toに於いて' do
before do
@belongs_to = @my_manifest.associations.belongs_to
- @names = ['author']
+ @names = ['artist', 'license', 'system_picture']
end
it 'これらのモデルに所属している' do
set_associations? @belongs_to, @names
end
- describe 'authorに於いて' do
+ describe 'artistに於いて' do
before do
- @mani = @belongs_to['author']
+ @mani = @belongs_to['artist']
end
it 'マニフェストから設定を取り出している' do
# モデル名と外部キーが定義あるいはデフォルト値補充されている
- expect(@mani.model_name).to eq 'author'
- expect(@mani.id_column).to eq 'author_id'
+ expect(@mani.model_name).to eq 'artist'
+ expect(@mani.id_column).to eq 'artist_id'
end
it 'サポート機能が動作している' do
# モデルを再現できている
- expect(@mani.model).to eq Author
+ expect(@mani.model).to eq Artist
end
end
- end
- describe 'has_manyに於いて' do
- before do
- @has_many = @model.my_manifest.associations.has_many
- @names = ['scroll_panels', 'panels']
- end
- it 'これらのモデルを所持している' do
- set_associations? @has_many, @names
- end
- describe 'scroll_panelsに於いて' do
+ describe 'licenseに於いて' do
before do
- @mani = @has_many['scroll_panels']
+ @mani = @belongs_to['license']
end
it 'マニフェストから設定を取り出している' do
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
- expect(@mani.model_name).to eq 'scroll_panel'
- expect(@mani.foreign_key).to eq 'scroll_id'
- expect(@mani.through).to be nil
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'license'
+ expect(@mani.id_column).to eq 'license_id'
end
it 'サポート機能が動作している' do
- # モデルを再現できている, 中間モデルフラグ
- expect(@mani.through?).to be false
- expect(@mani.model).to eq ScrollPanel
+ # モデルを再現できている
+ expect(@mani.model).to eq License
end
end
- describe 'panelsに於いて' do
+ describe 'system_pictureに於いて' do
before do
- @mani = @has_many['panels']
+ @mani = @belongs_to['system_picture']
end
it 'マニフェストから設定を取り出している' do
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
- expect(@mani.model_name).to eq 'panel'
- expect(@mani.foreign_key).to eq 'scroll_id'
- expect(@mani.through).to eq 'scroll_panels'
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'system_picture'
+ expect(@mani.id_column).to eq 'system_picture_id'
end
it 'サポート機能が動作している' do
- # モデルを再現できている, 中間モデルフラグ
- expect(@mani.through?).to be true
- expect(@mani.model).to eq Panel
+ # モデルを再現できている
+ expect(@mani.model).to eq SystemPicture
end
end
end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @model.my_manifest.associations.has_many
+ @names = []
+ end
+ it 'これらのモデルを所持している' do
+ set_associations? @has_many, @names
+ end
+ end
end
describe 'attributesに於いて' do
end
it 'これらのカラムを定義している' do
set_attributes? @attributes,
- ['id', 'title', 'description', 'visible', 'author_id',
+ ['id', 'original_picture_id', 'revision', 'ext',
+ 'width', 'height', 'filesize', 'artist_id', 'license_id', 'md5', 'system_picture_id',
+ 'license_group_settings', 'credit_picture_settings',
+ 'license_settings', 'license_group_module_name',
'created_at', 'updated_at']
end
- describe 'titleに於いて' do
+ describe 'original_picture_idに於いて' do
before do
- @attribute = @attributes['title']
+ @attribute = @attributes['original_picture_id']
end
- it 'textタイプである' do
- expect(@attribute.type).to eq 'text'
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
end
end
- describe 'descriptionに於いて' do
+ describe 'revisionに於いて' do
before do
- @attribute = @attributes['description']
+ @attribute = @attributes['revision']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'extに於いて' do
+ before do
+ @attribute = @attributes['ext']
end
it 'textタイプである' do
expect(@attribute.type).to eq 'text'
end
end
- describe 'visibleに於いて' do
+ describe 'widthに於いて' do
before do
- @attribute = @attributes['visible']
+ @attribute = @attributes['width']
end
it 'numberタイプである' do
expect(@attribute.type).to eq 'number'
end
- it '選択肢を定数から取得できるように定義している' do
- expect(@attribute.source.type).to eq 'magic_number'
- expect(@attribute.source.select_item_name).to eq 'scroll_visible_items'
+ end
+ describe 'heightに於いて' do
+ before do
+ @attribute = @attributes['height']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
end
end
- describe 'author_idに於いて' do
+ describe 'filesizeに於いて' do
before do
- @attribute = @attributes['author_id']
+ @attribute = @attributes['filesize']
end
it 'numberタイプである' do
expect(@attribute.type).to eq 'number'
end
end
+ describe 'artist_idに於いて' do
+ before do
+ @attribute = @attributes['artist_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'license_idに於いて' do
+ before do
+ @attribute = @attributes['license_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'md5に於いて' do
+ before do
+ @attribute = @attributes['md5']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'system_picture_idに於いて' do
+ before do
+ @attribute = @attributes['system_picture_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'license_group_settingsに於いて' do
+ before do
+ @attribute = @attributes['license_group_settings']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'credit_picture_settingsに於いて' do
+ before do
+ @attribute = @attributes['credit_picture_settings']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'license_settingsに於いて' do
+ before do
+ @attribute = @attributes['license_settings']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'license_group_module_nameに於いて' do
+ before do
+ @attribute = @attributes['license_group_module_name']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
end
end
end\r
\r
describe 'ペタナイズに於いて' do\r
- it 'スクコマを閉じるためのバインダーである' do\r
- expect(@model.ancestors.include?(Peta::Binder)).to eq true\r
+ it '絵師が投稿するコンテンツである' do\r
+ expect(@model.ancestors.include?(Peta::Content)).to eq true\r
end\r
it '親モデルは持たない' do\r
expect(@model.my_peta.parent_model_name).to be_blank\r
end\r
describe 'ブーストに於いて' do\r
- it '特筆すべき注意事項はない' do\r
- expect(@model.my_peta.boost.keys).to be_empty\r
+ before do\r
+ @boosts = @model.my_peta.boost\r
+ @boosts_names = ['license_group', 'license', 'credit_picture']\r
+ end\r
+ it 'これらのブーストが定義されている' do\r
+ set_boosts? @boosts, @boosts_names\r
+ end\r
+ describe 'ライセンスグループに於いて' do\r
+ before do\r
+ @mani = @boosts['license_group']\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.level).to eq 'post'\r
+ expect(@mani.template_name).to eq 'license_group'\r
+ expect(@mani.column_name_for_template_module).to eq 'license_group_module_name'\r
+ expect(@mani.settings_column_name).to eq 'license_group_settings'\r
+ expect(@mani.foreign_key).to eq 'license_group_id'\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.item_name_for_extend_model).to eq 'license'\r
+ expect(@mani.setter_method_name).to eq 'license_extend='\r
+ expect(@mani.getter_method_name).to eq 'license_extend'\r
+ expect(@mani.extend_model_class_name).to eq 'License'\r
+ expect(@mani.extend_module_name).to eq 'LicenseModule'\r
+ end\r
+ end\r
+ describe 'ライセンスに於いて' do\r
+ before do\r
+ @mani = @boosts['license']\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.level).to eq 'read'\r
+ expect(@mani.template_name).to eq 'license_group'\r
+ expect(@mani.column_name_for_template_module).to eq 'license_group_module_name'\r
+ expect(@mani.settings_column_name).to eq 'license_settings'\r
+ expect(@mani.foreign_key).to eq 'license_group_id'\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.item_name_for_extend_model).to eq 'attribute'\r
+ expect(@mani.setter_method_name).to eq 'attribute_extend='\r
+ expect(@mani.getter_method_name).to eq 'attribute_extend'\r
+ expect(@mani.extend_model_class_name).to eq 'Attribute'\r
+ expect(@mani.extend_module_name).to eq 'AttributeModule'\r
+ end\r
+ end\r
+ describe 'クレジットに於いて' do\r
+ before do\r
+ @mani = @boosts['credit_picture']\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.level).to eq 'read'\r
+ expect(@mani.template_name).to eq 'license_group'\r
+ expect(@mani.column_name_for_template_module).to eq 'license_group_module_name'\r
+ expect(@mani.settings_column_name).to eq 'credit_picture_settings'\r
+ expect(@mani.foreign_key).to eq 'license_group_id'\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.item_name_for_extend_model).to eq 'credit_picture'\r
+ expect(@mani.setter_method_name).to eq 'credit_picture_extend='\r
+ expect(@mani.getter_method_name).to eq 'credit_picture_extend'\r
+ expect(@mani.extend_model_class_name).to eq 'CreditPicture'\r
+ expect(@mani.extend_module_name).to eq 'CreditPictureModule'\r
+ end\r
end\r
end\r
\r
before do\r
@controller = @model.my_controller\r
end\r
- it 'スクロールのためのコントローラである' do\r
- expect(@model.item_name).to eq 'scroll'\r
+ it '実素材のためのコントローラである' do\r
+ expect(@model.item_name).to eq 'resource_picture'\r
end\r
describe 'actionに於いて' do\r
before do\r
@actions = @controller.actions\r
- @actions_names = ['index', 'by_author', 'by_panel', 'play', 'show', \r
- 'count', 'count_by_author', 'count_by_panel', \r
- 'new', 'edit', 'create', 'update', 'destroy']\r
+ @actions_names = ['index', 'by_license_group', 'by_license', 'by_artist', 'show', \r
+ 'count', 'count_by_license_group', 'count_by_license', 'count_by_artist']\r
end\r
it 'これらのアクションが定義されている' do\r
set_actions? @actions, @actions_names\r
expect(@action.type).to eq 'list'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # スクロールの公開リストを返すように定義している\r
- set_list_action? @action, 'scroll', 'public'\r
+ # 素材の公開リストを返すように定義している\r
+ set_list_action? @action, 'resource_picture', 'public'\r
end\r
end\r
- describe 'by_authorに於いて' do\r
+ describe 'by_license_groupに於いて' do\r
before do\r
- @action = @actions['by_author']\r
+ @action = @actions['by_license_group']\r
end\r
it 'listタイプのアクションである' do\r
expect(@action.type).to eq 'list'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # スクロールの作家フィルタリストを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_author'\r
+ # 素材のライセンスグループフィルタリストを返すように定義している\r
+ set_list_action? @action, 'resource_picture', 'by_license_group'\r
end\r
end\r
- describe 'by_panelに於いて' do\r
+ describe 'by_licenseに於いて' do\r
before do\r
- @action = @actions['by_panel']\r
+ @action = @actions['by_license']\r
end\r
it 'listタイプのアクションである' do\r
expect(@action.type).to eq 'list'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- #スクロールのコマフィルタリストを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_panel'\r
+ # 実素材のライセンスフィルタリストを返すように定義している\r
+ set_list_action? @action, 'resource_picture', 'by_license'\r
end\r
end\r
- describe 'countに於いて' do\r
+ describe 'by_artistに於いて' do\r
before do\r
- @action = @actions['count']\r
+ @action = @actions['by_artist']\r
end\r
- it 'countタイプのアクションである' do\r
- expect(@action.type).to eq 'count'\r
+ it 'listタイプのアクションである' do\r
+ expect(@action.type).to eq 'list'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- #スクロールの公開リストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'public'\r
+ # 素材の絵師フィルタリストを返すように定義している\r
+ set_list_action? @action, 'resource_picture', 'by_artist'\r
end\r
end\r
- describe 'count_by_authorに於いて' do\r
+ describe 'showに於いて' do\r
before do\r
- @action = @actions['count_by_author']\r
- end\r
- it 'countタイプのアクションである' do\r
- expect(@action.type).to eq 'count'\r
+ @action = @actions['show']\r
end\r
- it 'マニフェストから設定を取り出している' do\r
- # スクロールの作家フィルタリストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_author'\r
+ it 'showタイプのアクションである' do\r
+ expect(@action.type).to eq 'show'\r
end\r
end\r
- describe 'count_by_panelに於いて' do\r
+ describe 'countに於いて' do\r
before do\r
- @action = @actions['count_by_panel']\r
+ @action = @actions['count']\r
end\r
it 'countタイプのアクションである' do\r
expect(@action.type).to eq 'count'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # スクロールのコマフィルタリストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_panel'\r
- end\r
- end\r
- describe 'newに於いて' do\r
- before do\r
- @action = @actions['new']\r
- end\r
- it 'newタイプのアクションである' do\r
- expect(@action.type).to eq 'new'\r
- end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ # 素材の公開リストのカウントを返すように定義している\r
+ set_list_action? @action, 'resource_picture', 'public'\r
end\r
end\r
- describe 'editに於いて' do\r
+ describe 'count_by_license_groupに於いて' do\r
before do\r
- @action = @actions['edit']\r
- end\r
- it 'editタイプのアクションである' do\r
- expect(@action.type).to eq 'edit'\r
- end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ @action = @actions['count_by_license_group']\r
end\r
- end\r
- describe 'createに於いて' do\r
- before do\r
- @action = @actions['create']\r
- end\r
- it 'createタイプのアクションである' do\r
- expect(@action.type).to eq 'create'\r
+ it 'countタイプのアクションである' do\r
+ expect(@action.type).to eq 'count'\r
end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ it 'マニフェストから設定を取り出している' do\r
+ # 素材のライセンスグループフィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'resource_picture', 'by_license_group'\r
end\r
end\r
- describe 'updateに於いて' do\r
+ describe 'count_by_licenseに於いて' do\r
before do\r
- @action = @actions['update']\r
+ @action = @actions['count_by_license']\r
end\r
- it 'updateタイプのアクションである' do\r
- expect(@action.type).to eq 'update'\r
+ it 'countタイプのアクションである' do\r
+ expect(@action.type).to eq 'count'\r
end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ it 'マニフェストから設定を取り出している' do\r
+ # 素材のライセンスフィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'resource_picture', 'by_license'\r
end\r
end\r
- describe 'destroyに於いて' do\r
+ describe 'count_by_artistに於いて' do\r
before do\r
- @action = @actions['destroy']\r
+ @action = @actions['count_by_artist']\r
end\r
- it 'destroyタイプのアクションである' do\r
- expect(@action.type).to eq 'destroy'\r
+ it 'countタイプのアクションである' do\r
+ expect(@action.type).to eq 'count'\r
end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ it 'マニフェストから設定を取り出している' do\r
+ # 素材の絵師フィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'resource_picture', 'by_artist'\r
end\r
end\r
end\r
@my_manifest = @model.my_manifest\r
end\r
it 'サポート機能が動作している' do\r
- expect(@my_manifest.model_name).to eq 'scroll'\r
+ expect(@my_manifest.model_name).to eq 'resource_picture'\r
expect(@my_manifest.classify).to eq @model\r
- expect(@my_manifest.table_name).to eq 'scrolls'\r
+ expect(@my_manifest.table_name).to eq 'resource_pictures'\r
end\r
\r
describe 'associationsに於いて' do\r
describe 'belongs_toに於いて' do\r
before do\r
@belongs_to = @my_manifest.associations.belongs_to\r
- @names = ['author']\r
+ @names = ['original_picture', 'license_group', 'license', 'artist', 'system_picture']\r
end\r
it 'これらのモデルに所属している' do\r
set_associations? @belongs_to, @names\r
end\r
- describe 'authorに於いて' do\r
+ describe 'original_pictureに於いて' do\r
before do\r
- @mani = @belongs_to['author']\r
+ @mani = @belongs_to['original_picture']\r
end\r
it 'マニフェストから設定を取り出している' do\r
# モデル名と外部キーが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'author'\r
- expect(@mani.id_column).to eq 'author_id'\r
+ expect(@mani.model_name).to eq 'original_picture'\r
+ expect(@mani.id_column).to eq 'original_picture_id'\r
end\r
it 'サポート機能が動作している' do\r
# モデルを再現できている\r
- expect(@mani.model).to eq Author\r
+ expect(@mani.model).to eq OriginalPicture\r
end\r
end\r
- end\r
- describe 'has_manyに於いて' do\r
- before do\r
- @has_many = @model.my_manifest.associations.has_many\r
- @names = ['scroll_panels', 'panels']\r
+ describe 'license_groupに於いて' do\r
+ before do\r
+ @mani = @belongs_to['license_group']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'license_group'\r
+ expect(@mani.id_column).to eq 'license_group_id'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq LicenseGroup\r
+ end\r
end\r
- it 'これらのモデルを所持している' do\r
- set_associations? @has_many, @names\r
+ describe 'artistに於いて' do\r
+ before do\r
+ @mani = @belongs_to['artist']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'artist'\r
+ expect(@mani.id_column).to eq 'artist_id'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq Artist\r
+ end\r
end\r
- describe 'scroll_panelsに於いて' do\r
+ describe 'licenseに於いて' do\r
before do\r
- @mani = @has_many['scroll_panels']\r
+ @mani = @belongs_to['license']\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'scroll_panel'\r
- expect(@mani.foreign_key).to eq 'scroll_id'\r
- expect(@mani.through).to be nil\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'license'\r
+ expect(@mani.id_column).to eq 'license_id'\r
end\r
it 'サポート機能が動作している' do\r
- # モデルを再現できている, 中間モデルフラグ\r
- expect(@mani.through?).to be false\r
- expect(@mani.model).to eq ScrollPanel\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq License\r
end\r
end\r
- describe 'panelsに於いて' do\r
+ describe 'system_pictureに於いて' do\r
before do\r
- @mani = @has_many['panels']\r
+ @mani = @belongs_to['system_picture']\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'panel'\r
- expect(@mani.foreign_key).to eq 'scroll_id'\r
- expect(@mani.through).to eq 'scroll_panels'\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'system_picture'\r
+ expect(@mani.id_column).to eq 'system_picture_id'\r
end\r
it 'サポート機能が動作している' do\r
- # モデルを再現できている, 中間モデルフラグ\r
- expect(@mani.through?).to be true\r
- expect(@mani.model).to eq Panel\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq SystemPicture\r
end\r
end\r
end\r
+ describe 'has_manyに於いて' do\r
+ before do\r
+ @has_many = @model.my_manifest.associations.has_many\r
+ @names = []\r
+ end\r
+ it 'これらのモデルを所持している' do\r
+ set_associations? @has_many, @names\r
+ end\r
+ end\r
end\r
\r
describe 'attributesに於いて' do\r
end\r
it 'これらのカラムを定義している' do\r
set_attributes? @attributes, \r
- ['id', 'title', 'description', 'visible', 'author_id', \r
+ ['id', 'original_picture_id', 'ext', \r
+ 'width', 'height', 'filesize', 'artist_id', 'license_group_id', 'license_id', \r
+ 'md5', 'system_picture_id', \r
+ 'license_group_settings', 'credit_picture_settings', \r
+ 'license_settings', 'picture_id', 'license_group_module_name', \r
'created_at', 'updated_at']\r
end\r
- describe 'titleに於いて' do\r
+ describe 'original_picture_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['original_picture_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'extに於いて' do\r
before do\r
- @attribute = @attributes['title']\r
+ @attribute = @attributes['ext']\r
end\r
it 'textタイプである' do\r
expect(@attribute.type).to eq 'text'\r
end\r
end\r
- describe 'descriptionに於いて' do\r
+ describe 'widthに於いて' do\r
+ before do\r
+ @attribute = @attributes['width']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'heightに於いて' do\r
+ before do\r
+ @attribute = @attributes['height']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'filesizeに於いて' do\r
+ before do\r
+ @attribute = @attributes['filesize']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'artist_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['artist_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'license_group_idに於いて' do\r
before do\r
- @attribute = @attributes['description']\r
+ @attribute = @attributes['license_group_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'license_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['license_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'md5に於いて' do\r
+ before do\r
+ @attribute = @attributes['md5']\r
end\r
it 'textタイプである' do\r
expect(@attribute.type).to eq 'text'\r
end\r
end\r
- describe 'visibleに於いて' do\r
+ describe 'system_picture_idに於いて' do\r
before do\r
- @attribute = @attributes['visible']\r
+ @attribute = @attributes['system_picture_id']\r
end\r
it 'numberタイプである' do\r
expect(@attribute.type).to eq 'number'\r
end\r
- it '選択肢を定数から取得できるように定義している' do\r
- expect(@attribute.source.type).to eq 'magic_number'\r
- expect(@attribute.source.select_item_name).to eq 'scroll_visible_items'\r
+ end\r
+ describe 'license_group_settingsに於いて' do\r
+ before do\r
+ @attribute = @attributes['license_group_settings']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
end\r
end\r
- describe 'author_idに於いて' do\r
+ describe 'credit_picture_settingsに於いて' do\r
before do\r
- @attribute = @attributes['author_id']\r
+ @attribute = @attributes['credit_picture_settings']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'license_settingsに於いて' do\r
+ before do\r
+ @attribute = @attributes['license_settings']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'picture_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['picture_id']\r
end\r
it 'numberタイプである' do\r
expect(@attribute.type).to eq 'number'\r
end\r
end\r
+ describe 'license_group_module_nameに於いて' do\r
+ before do\r
+ @attribute = @attributes['license_group_module_name']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
end\r
\r
end\r
end\r
\r
describe 'ペタナイズに於いて' do\r
- it 'ã\82¹ã\82¯ã\82³ã\83\9eã\82\92é\96\89ã\81\98ã\82\8bã\81\9fã\82\81ã\81®ã\83\90ã\82¤ã\83³ã\83\80ã\83¼である' do\r
- expect(@model.ancestors.include?(Peta::Binder)).to eq true\r
+ it 'ã\83\95ã\82ã\83\80ã\82·ã\81®è¦\81ç´ ã\81¨ã\81\97ã\81¦å\88©ç\94¨ã\81\95ã\82\8cã\82\8bã\82¨ã\83¬ã\83¡ã\83³ã\83\88である' do\r
+ expect(@model.ancestors.include?(Peta::Element)).to eq true\r
end\r
- it '親モデルは持たない' do\r
- expect(@model.my_peta.parent_model_name).to be_blank\r
+ it '親モデルはフキダシである' do\r
+ expect(@model.my_peta.parent_model_name).to eq 'speech_balloon'\r
end\r
describe 'ブーストに於いて' do\r
- it '特筆すべき注意事項はない' do\r
- expect(@model.my_peta.boost.keys).to be_empty\r
+ before do\r
+ @boosts = @model.my_peta.boost\r
+ @boosts_names = ['speech_balloon_template', 'writing_format']\r
+ end\r
+ it 'これらのブーストが定義されている' do\r
+ set_boosts? @boosts, @boosts_names\r
+ end\r
+ describe 'フキダシテンプレートに於いて' do\r
+ before do\r
+ @mani = @boosts['speech_balloon_template']\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.level).to eq 'post'\r
+ expect(@mani.template_name).to eq 'speech_balloon_template'\r
+ expect(@mani.column_name_for_template_module).to eq 'speech_balloon_template_module_name'\r
+ expect(@mani.settings_column_name).to eq 'speech_balloon_template_settings'\r
+ expect(@mani.foreign_key).to eq 'speech_balloon_template_id'\r
+ end\r
+ it 'フキダシテンプレート' do\r
+ expect(@mani.item_name_for_extend_model).to eq 'speech'\r
+ expect(@mani.setter_method_name).to eq 'speech_extend='\r
+ expect(@mani.getter_method_name).to eq 'speech_extend'\r
+ expect(@mani.extend_model_class_name).to eq 'Speech'\r
+ expect(@mani.extend_module_name).to eq 'SpeechModule'\r
+ end\r
+ end\r
+ describe '記法に於いて' do\r
+ before do\r
+ @mani = @boosts['writing_format']\r
+ end\r
+ it '記法' do\r
+ expect(@mani.level).to eq 'read'\r
+ expect(@mani.template_name).to eq 'writing_format'\r
+ expect(@mani.column_name_for_template_module).to eq 'writing_format_module_name'\r
+ expect(@mani.settings_column_name).to eq 'writing_format_settings'\r
+ expect(@mani.foreign_key).to eq 'writing_format_id'\r
+ end\r
+ it '記法' do\r
+ expect(@mani.item_name_for_extend_model).to eq 'renderer'\r
+ expect(@mani.setter_method_name).to eq 'renderer_extend='\r
+ expect(@mani.getter_method_name).to eq 'renderer_extend'\r
+ expect(@mani.extend_model_class_name).to be nil\r
+ expect(@mani.extend_module_name).to eq 'RendererModule'\r
+ end\r
end\r
end\r
\r
before do\r
@controller = @model.my_controller\r
end\r
- it 'ã\82¹ã\82¯ã\83ã\83¼ã\83«のためのコントローラである' do\r
- expect(@model.item_name).to eq 'scroll'\r
+ it 'ã\82»ã\83ªã\83\95のためのコントローラである' do\r
+ expect(@model.item_name).to eq 'speech'\r
end\r
describe 'actionに於いて' do\r
before do\r
@actions = @controller.actions\r
- @actions_names = ['index', 'by_author', 'by_panel', 'play', 'show', \r
- 'count', 'count_by_author', 'count_by_panel', \r
- 'new', 'edit', 'create', 'update', 'destroy']\r
+ @actions_names = ['index', 'by_author', 'show', \r
+ 'count', 'count_by_author', \r
+ 'new', 'edit']\r
end\r
it 'これらのアクションが定義されている' do\r
set_actions? @actions, @actions_names\r
expect(@action.type).to eq 'list'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # ã\82¹ã\82¯ã\83ã\83¼ã\83«の公開リストを返すように定義している\r
- set_list_action? @action, 'scroll', 'public'\r
+ # ã\82»ã\83ªã\83\95の公開リストを返すように定義している\r
+ set_list_action? @action, 'speech', 'public'\r
end\r
end\r
describe 'by_authorに於いて' do\r
expect(@action.type).to eq 'list'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # スクロールの作家フィルタリストを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_author'\r
- end\r
- end\r
- describe 'by_panelに於いて' do\r
- before do\r
- @action = @actions['by_panel']\r
- end\r
- it 'listタイプのアクションである' do\r
- expect(@action.type).to eq 'list'\r
- end\r
- it 'マニフェストから設定を取り出している' do\r
- #スクロールのコマフィルタリストを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_panel'\r
+ # セリフの作家フィルタリストを返すように定義している\r
+ set_list_action? @action, 'speech', 'by_author'\r
end\r
end\r
describe 'countに於いて' do\r
expect(@action.type).to eq 'count'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- #ã\82¹ã\82¯ã\83ã\83¼ã\83«の公開リストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'public'\r
+ #ã\82»ã\83ªã\83\95の公開リストのカウントを返すように定義している\r
+ set_list_action? @action, 'speech', 'public'\r
end\r
end\r
describe 'count_by_authorに於いて' do\r
expect(@action.type).to eq 'count'\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # スクロールの作家フィルタリストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_author'\r
- end\r
- end\r
- describe 'count_by_panelに於いて' do\r
- before do\r
- @action = @actions['count_by_panel']\r
- end\r
- it 'countタイプのアクションである' do\r
- expect(@action.type).to eq 'count'\r
- end\r
- it 'マニフェストから設定を取り出している' do\r
- # スクロールのコマフィルタリストのカウントを返すように定義している\r
- set_list_action? @action, 'scroll', 'by_panel'\r
+ # セリフの作家フィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'speech', 'by_author'\r
end\r
end\r
describe 'newに於いて' do\r
expect(@action.type).to eq 'new'\r
end\r
it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ expect(@action.item_name).to eq 'speech'\r
end\r
end\r
describe 'editに於いて' do\r
expect(@action.type).to eq 'edit'\r
end\r
it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
- end\r
- end\r
- describe 'createに於いて' do\r
- before do\r
- @action = @actions['create']\r
- end\r
- it 'createタイプのアクションである' do\r
- expect(@action.type).to eq 'create'\r
- end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
- end\r
- end\r
- describe 'updateに於いて' do\r
- before do\r
- @action = @actions['update']\r
- end\r
- it 'updateタイプのアクションである' do\r
- expect(@action.type).to eq 'update'\r
- end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
- end\r
- end\r
- describe 'destroyに於いて' do\r
- before do\r
- @action = @actions['destroy']\r
- end\r
- it 'destroyタイプのアクションである' do\r
- expect(@action.type).to eq 'destroy'\r
- end\r
- it 'type' do\r
- expect(@action.item_name).to eq 'scroll'\r
+ expect(@action.item_name).to eq 'speech'\r
end\r
end\r
end\r
@my_manifest = @model.my_manifest\r
end\r
it 'サポート機能が動作している' do\r
- expect(@my_manifest.model_name).to eq 'scroll'\r
+ expect(@my_manifest.model_name).to eq 'speech'\r
expect(@my_manifest.classify).to eq @model\r
- expect(@my_manifest.table_name).to eq 'scrolls'\r
+ expect(@my_manifest.table_name).to eq 'speeches'\r
end\r
\r
describe 'associationsに於いて' do\r
describe 'belongs_toに於いて' do\r
before do\r
@belongs_to = @my_manifest.associations.belongs_to\r
- @names = ['author']\r
+ @names = ['speech_balloon', 'writing_format', 'speech_balloon_template']\r
end\r
it 'これらのモデルに所属している' do\r
set_associations? @belongs_to, @names\r
end\r
- describe 'authorに於いて' do\r
+ describe 'speech_balloonに於いて' do\r
before do\r
- @mani = @belongs_to['author']\r
+ @mani = @belongs_to['speech_balloon']\r
end\r
it 'マニフェストから設定を取り出している' do\r
# モデル名と外部キーが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'author'\r
- expect(@mani.id_column).to eq 'author_id'\r
+ expect(@mani.model_name).to eq 'speech_balloon'\r
+ expect(@mani.id_column).to eq 'speech_balloon_id'\r
end\r
it 'サポート機能が動作している' do\r
# モデルを再現できている\r
- expect(@mani.model).to eq Author\r
+ expect(@mani.model).to eq SpeechBalloon\r
end\r
end\r
- end\r
- describe 'has_manyに於いて' do\r
- before do\r
- @has_many = @model.my_manifest.associations.has_many\r
- @names = ['scroll_panels', 'panels']\r
- end\r
- it 'これらのモデルを所持している' do\r
- set_associations? @has_many, @names\r
- end\r
- describe 'scroll_panelsに於いて' do\r
+ describe 'writing_formatに於いて' do\r
before do\r
- @mani = @has_many['scroll_panels']\r
+ @mani = @belongs_to['writing_format']\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'scroll_panel'\r
- expect(@mani.foreign_key).to eq 'scroll_id'\r
- expect(@mani.through).to be nil\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'writing_format'\r
+ expect(@mani.id_column).to eq 'writing_format_id'\r
end\r
it 'サポート機能が動作している' do\r
- # モデルを再現できている, 中間モデルフラグ\r
- expect(@mani.through?).to be false\r
- expect(@mani.model).to eq ScrollPanel\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq WritingFormat\r
end\r
end\r
- describe 'panelsに於いて' do\r
+ describe 'speech_balloon_templateに於いて' do\r
before do\r
- @mani = @has_many['panels']\r
+ @mani = @belongs_to['speech_balloon_template']\r
end\r
it 'マニフェストから設定を取り出している' do\r
- # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
- expect(@mani.model_name).to eq 'panel'\r
- expect(@mani.foreign_key).to eq 'scroll_id'\r
- expect(@mani.through).to eq 'scroll_panels'\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'speech_balloon_template'\r
+ expect(@mani.id_column).to eq 'speech_balloon_template_id'\r
end\r
it 'サポート機能が動作している' do\r
- # モデルを再現できている, 中間モデルフラグ\r
- expect(@mani.through?).to be true\r
- expect(@mani.model).to eq Panel\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq SpeechBalloonTemplate\r
end\r
end\r
end\r
+ describe 'has_manyに於いて' do\r
+ before do\r
+ @has_many = @model.my_manifest.associations.has_many\r
+ @names = []\r
+ end\r
+ it 'これらのモデルを所持している' do\r
+ set_associations? @has_many, @names\r
+ end\r
+ end\r
end\r
\r
describe 'attributesに於いて' do\r
end\r
it 'これらのカラムを定義している' do\r
set_attributes? @attributes, \r
- ['id', 'title', 'description', 'visible', 'author_id', \r
+ ['id', 'speech_balloon_id', 'speech_balloon_template_id', 'speech_balloon_template_module_name', \r
+ 'writing_format_id', 'writing_format_module_name', 'content', \r
+ 'font_size', 'text_align', 'fore_color', \r
+ 'x', 'y', 'width', 'height', 'quotes', \r
+ 'speech_balloon_template_settings', 'writing_format_settings', \r
'created_at', 'updated_at']\r
end\r
- describe 'titleに於いて' do\r
+ describe 'speech_balloon_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['speech_balloon_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'speech_balloon_template_idに於いて' do\r
before do\r
- @attribute = @attributes['title']\r
+ @attribute = @attributes['speech_balloon_template_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'speech_balloon_template_module_nameに於いて' do\r
+ before do\r
+ @attribute = @attributes['speech_balloon_template_module_name']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'writing_format_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['writing_format_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'writing_format_module_nameに於いて' do\r
+ before do\r
+ @attribute = @attributes['writing_format_module_name']\r
end\r
it 'textタイプである' do\r
expect(@attribute.type).to eq 'text'\r
end\r
end\r
- describe 'descriptionに於いて' do\r
+ describe 'contentに於いて' do\r
before do\r
- @attribute = @attributes['description']\r
+ @attribute = @attributes['content']\r
end\r
it 'textタイプである' do\r
expect(@attribute.type).to eq 'text'\r
end\r
end\r
- describe 'visibleに於いて' do\r
+ describe 'font_sizeに於いて' do\r
+ before do\r
+ @attribute = @attributes['font_size']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'float'\r
+ end\r
+ it '選択肢を定数から取得できるように定義している' do\r
+ expect(@attribute.source.type).to eq 'magic_number'\r
+ expect(@attribute.source.select_item_name).to eq 'speech_font_size_items'\r
+ end\r
+ end\r
+ describe 'text_alignに於いて' do\r
before do\r
- @attribute = @attributes['visible']\r
+ @attribute = @attributes['text_align']\r
end\r
it 'numberタイプである' do\r
expect(@attribute.type).to eq 'number'\r
end\r
it '選択肢を定数から取得できるように定義している' do\r
expect(@attribute.source.type).to eq 'magic_number'\r
- expect(@attribute.source.select_item_name).to eq 'scroll_visible_items'\r
+ expect(@attribute.source.select_item_name).to eq 'speech_text_align_items'\r
+ end\r
+ end\r
+ describe 'fore_colorに於いて' do\r
+ before do\r
+ @attribute = @attributes['fore_color']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'xに於いて' do\r
+ before do\r
+ @attribute = @attributes['x']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
end\r
end\r
- describe 'author_idに於いて' do\r
+ describe 'yに於いて' do\r
before do\r
- @attribute = @attributes['author_id']\r
+ @attribute = @attributes['y']\r
end\r
it 'numberタイプである' do\r
expect(@attribute.type).to eq 'number'\r
end\r
end\r
+ describe 'widthに於いて' do\r
+ before do\r
+ @attribute = @attributes['width']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'heightに於いて' do\r
+ before do\r
+ @attribute = @attributes['height']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'quotesに於いて' do\r
+ before do\r
+ @attribute = @attributes['quotes']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'speech_balloon_template_settingsに於いて' do\r
+ before do\r
+ @attribute = @attributes['speech_balloon_template_settings']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'writing_format_settingsに於いて' do\r
+ before do\r
+ @attribute = @attributes['writing_format_settings']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
end\r
\r
end\r