group :test do
gem 'autotest'
+ gem 'spork'
+ gem 'guard'
+ gem 'guard-spork'
+ gem 'guard-rspec'
gem 'webmock'
gem 'rspec'
gem 'rspec-rails'
--- /dev/null
+# A sample Guardfile
+# More info at https://github.com/guard/guard#readme
+
+guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
+ watch('config/application.rb')
+ watch('config/environment.rb')
+ watch('config/environments/test.rb')
+ watch(%r{^config/initializers/.+\.rb$})
+ watch('Gemfile.lock')
+ watch('spec/spec_helper.rb') { :rspec }
+ watch('test/test_helper.rb') { :test_unit }
+ watch(%r{features/support/}) { :cucumber }
+end
+
+# Note: The cmd option is now required due to the increasing number of ways
+# rspec may be run, below are examples of the most common uses.
+# * bundler: 'bundle exec rspec'
+# * bundler binstubs: 'bin/rspec'
+# * spring: 'bin/rsspec' (This will use spring if running and you have
+# installed the spring binstubs per the docs)
+# * zeus: 'zeus rspec' (requires the server to be started separetly)
+# * 'just' rspec: 'rspec'
+guard :rspec, cmd: 'bundle exec rspec' do
+ watch(%r{^spec/.+_spec\.rb$})
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
+ watch('spec/spec_helper.rb') { "spec" }
+
+ # Rails example
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
+ watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
+ watch('config/routes.rb') { "spec/routing" }
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
+ watch('spec/rails_helper.rb') { "spec" }
+
+ # Capybara features specs
+ watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
+
+ # Turnip features and steps
+ watch(%r{^spec/acceptance/(.+)\.feature$})
+ watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
+end
+
by_story: {\r
type: 'list',\r
},\r
- by_author: {\r
- type: 'list',\r
- },\r
show: {\r
type: 'show',\r
},\r
count_by_story: {\r
type: 'count',\r
},\r
- count_by_author: {\r
- type: 'count',\r
- },\r
new: {\r
type: 'new',\r
},\r
min: 0,\r
}\r
},\r
- author_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
},\r
},\r
comic: {\r
min: 0,\r
}\r
},\r
- author_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
},\r
},\r
story: {\r
associations: {\r
belongs_to: {\r
+ author: {\r
+ }, \r
},\r
has_many: {\r
comic_stories: {\r
min: 0,\r
}\r
},\r
- author_id: {\r
- type: 'number',\r
- rules : {\r
- required: true,\r
- number: true,\r
- }\r
- },\r
},\r
},\r
sheet: {\r
source: {\r
type: 'magic_number',\r
args: {\r
- select_item_name: 'panel_visible_items',\r
+ select_item_name: 'panel_publish_items',\r
},\r
},\r
},\r
required: true,\r
}\r
},\r
- author_id: {\r
+ user_id: {\r
type: 'number',\r
rules : {\r
required: true,\r
['select_items.sheet.visible.private', 0], \r
['select_items.sheet.visible.public', 1], \r
],\r
- panel_visible_items: [\r
- ['select_items.panel.visible.private', 0], \r
- ['select_items.panel.visible.public', 1], \r
+ panel_publish_items: [\r
+ ['select_items.panel.publish.private', 0], \r
+ ['select_items.panel.publish.public', 1], \r
],\r
ground_picture_repeat_items: [\r
['select_items.ground_pictures.repeat.repeat', 0], \r
},\r
"edit": {\r
"type": "edit"\r
+ },\r
+ "destroy": {\r
+ "type": "destroy"\r
}\r
}\r
},\r
"by_story": {\r
"type": "list"\r
},\r
- "by_author": {\r
- "type": "list"\r
- },\r
"show": {\r
"type": "show"\r
},\r
"count_by_story": {\r
"type": "count"\r
},\r
- "count_by_author": {\r
- "type": "count"\r
- },\r
"new": {\r
"type": "new"\r
},\r
"number": true,\r
"min": 0\r
}\r
- },\r
- "author_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
}\r
}\r
},\r
"number": true,\r
"min": 0\r
}\r
- },\r
- "author_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
}\r
}\r
},\r
"story": {\r
"associations": {\r
- "belongs_to": {},\r
+ "belongs_to": {\r
+ "author": {}\r
+ },\r
"has_many": {\r
"comic_stories": {},\r
"comics": {\r
"number": true,\r
"min": 0\r
}\r
- },\r
- "author_id": {\r
- "type": "number",\r
- "rules": {\r
- "required": true,\r
- "number": true\r
- }\r
}\r
}\r
},\r
"source": {\r
"type": "magic_number",\r
"args": {\r
- "select_item_name": "panel_visible_items"\r
+ "select_item_name": "panel_publish_items"\r
}\r
}\r
},\r
"required": true\r
}\r
},\r
- "author_id": {\r
+ "user_id": {\r
"type": "number",\r
"rules": {\r
"required": true,\r
1\r
]\r
],\r
- "panel_visible_items": [\r
+ "panel_publish_items": [\r
[\r
- "select_items.panel.visible.private",\r
+ "select_items.panel.publish.private",\r
0\r
],\r
[\r
- "select_items.panel.visible.public",\r
+ "select_items.panel.publish.public",\r
1\r
]\r
],\r
--- /dev/null
+fs = Dir.glob(File.dirname(__FILE__) + '/local_manifests/*_spec.rb').map {|f| f }.join(' ')\r
+ system 'rspec --drb ' + fs\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+#絵師
+require 'spec_helper'
+
+describe Artist do
+ include LocalManifestsMacros
+ before do
+ @model = Artist
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#作家
+require 'spec_helper'
+
+describe Author do
+ include LocalManifestsMacros
+ before do
+ @model = Author
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+require 'spec_helper'\r
+#フキダシ枠\r
+describe Balloon do\r
+ include LocalManifestsMacros\r
+ before do\r
+ @model = Balloon\r
+ end\r
+ \r
+ describe 'ファイラーに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_local_manifest.item_class).to eq @model\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ expect(@my_local_manifest.filer_name).to eq @model.item_name\r
+ end\r
+ describe 'symbolに於いて' do\r
+ before do\r
+ @symbol = @my_local_manifest.symbol\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@symbol.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@symbol.visible?).to be true\r
+ end\r
+ describe 'faceに於いて' do\r
+ before do\r
+ @face = @symbol.face\r
+ end\r
+ it 'imageタイプのfaceである' do\r
+ expect(@face.type).to eq 'image'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@face.url).to eq '/images/scroll.gif'\r
+ end\r
+ end\r
+ describe 'linkに於いて' do\r
+ before do\r
+ @link = @symbol.link\r
+ end\r
+ it 'actionタイプのlinkである' do\r
+ expect(@link.type).to eq 'action'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@link.action_name).to eq 'show'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@link.action_path).to eq '/scrolls/'\r
+ end\r
+ end\r
+ end\r
+ describe 'captionに於いて' do\r
+ before do\r
+ @caption = @my_local_manifest.caption\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@caption.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@caption.visible?).to be true\r
+ end\r
+ describe 'faceに於いて' do\r
+ before do\r
+ @face = @caption.face\r
+ end\r
+ it 'columnタイプのfaceである' do\r
+ expect(@face.type).to eq 'column'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@face.column_name).to eq 'title'\r
+ end\r
+ end\r
+ describe 'linkに於いて' do\r
+ before do\r
+ @link = @caption.link\r
+ end\r
+ it 'actionタイプのlinkである' do\r
+ expect(@link.type).to eq 'action'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@link.action_name).to eq 'play'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@link.action_path).to eq '/scrolls/play/'\r
+ end\r
+ end\r
+ end\r
+ describe 'summaryに於いて' do\r
+ before do\r
+ @summary = @my_local_manifest.summary\r
+ end\r
+ it 'templateタイプのsymbolである' do\r
+ expect(@summary.type).to eq 'template'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@summary.template_name).to eq 'summary'\r
+ end\r
+ end\r
+ describe 'iconに於いて' do\r
+ before do\r
+ @icon = @my_local_manifest.icon\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@icon.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@icon.visible?).to be true\r
+ end\r
+ end\r
+ describe 'dateに於いて' do\r
+ before do\r
+ @date = @my_local_manifest.date\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@date.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@date.visible?).to be true\r
+ end\r
+ end\r
+ describe 'editに於いて' do\r
+ before do\r
+ @edit = @my_local_manifest.edit\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@edit.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@edit.visible?).to be true\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'プロファイラーに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ describe 'columnsに於いて' do\r
+ before do\r
+ @columns = @my_local_manifest.columns\r
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']\r
+ end\r
+ it 'これらのカラムが定義されている' do\r
+ set_columns? @columns, @names\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @column = @columns['title']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @column = @columns['description']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @column = @columns['visible']\r
+ end\r
+ it 'sourceタイプのcolumnである' do\r
+ expect(@column.type).to eq 'source'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @column = @columns['author_id']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ end\r
+ describe 'column_namesに於いて' do\r
+ before do\r
+ @column_names = @my_local_manifest.column_names\r
+ end\r
+ it '数量が守られている' do\r
+ expect(@column_names.size).to eq 4 + 3\r
+ end\r
+ it '順序が守られている' do\r
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']\r
+ end\r
+ end\r
+ describe 'extend_settingsに於いて' do\r
+ before do\r
+ @extend_settings = @my_local_manifest.extend_settings\r
+ end\r
+ it '拡張カラムは無い' do\r
+ expect(@extend_settings).to be_empty\r
+ end\r
+ end\r
+ describe 'listsに於いて' do\r
+ before do\r
+ @lists = @my_local_manifest.lists\r
+ end\r
+ it '無い' do\r
+ expect(@lists).to be_empty\r
+ end\r
+ end\r
+ describe 'associationsに於いて' do\r
+ before do\r
+ @associations = @my_local_manifest.associations\r
+ end\r
+ describe 'belongs_toに於いて' do\r
+ before do\r
+ @belongs_to = @associations.belongs_to\r
+ end\r
+ it 'これらの所属モデルを取り扱う' do\r
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']\r
+ end\r
+ describe 'authorに於いて' do\r
+ before do\r
+ @mani = @belongs_to[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'author'\r
+ expect(@mani.model_name).to eq 'author'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq Author\r
+ end\r
+ end\r
+ end\r
+ describe 'has_manyに於いて' do\r
+ before do\r
+ @has_many = @associations.has_many\r
+ end\r
+ it 'これらの所持モデルを取り扱う' do\r
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']\r
+ end\r
+ describe 'scroll_panelsに於いて' do\r
+ before do\r
+ @mani = @has_many[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'\r
+ expect(@mani.model_name).to eq 'scroll_panel'\r
+ expect(@mani.list_name).to eq 'by_scroll'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq ScrollPanel\r
+ end\r
+ end\r
+ describe 'panels.by_scrollに於いて' do\r
+ before do\r
+ @mani = @has_many[1]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'panels.by_scroll'\r
+ expect(@mani.model_name).to eq 'panel'\r
+ expect(@mani.list_name).to eq 'by_scroll'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq Panel\r
+ end\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'リストグループに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ describe 'listsに於いて' do\r
+ before do\r
+ @lists = @my_local_manifest.lists\r
+ end\r
+ it 'これらのリストを定義している' do\r
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']\r
+ end\r
+ describe 'publicに於いて' do\r
+ before do\r
+ @mani = @lists['public']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.type).to eq 'public'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.model).to eq Scroll\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.has_id?).to be nil\r
+ expect(@mani.pre_id?).to be true\r
+ expect(@mani.item_name).to eq @model.item_name\r
+ end\r
+ describe 'whereに於いて' do\r
+ before do\r
+ @where = @mani.where\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@where.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@where.item_name).to eq @model.item_name\r
+ expect(@where.list_name).to eq 'public'\r
+ expect(@where.model).to eq Scroll\r
+ end\r
+ it 'method_name' do\r
+ expect(@where.method_name).to eq 'public_list_where'\r
+ end\r
+ end\r
+ describe 'includesに於いて' do\r
+ before do\r
+ @includes = @mani.includes\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@includes.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@includes.item_name).to eq @model.item_name\r
+ expect(@includes.list_name).to eq 'public'\r
+ expect(@includes.model).to eq Scroll\r
+ end\r
+ it 'includes' do\r
+ expect(@includes.includes).to be_empty\r
+ end\r
+ end\r
+ describe 'orderに於いて' do\r
+ before do\r
+ @order = @mani.order\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@order.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@order.item_name).to eq @model.item_name\r
+ expect(@order.list_name).to eq 'public'\r
+ expect(@order.model).to eq Scroll\r
+ end\r
+ it 'order' do\r
+ expect(@order.order).to eq 'list_order'\r
+ end\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe '入力フォームに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.name).to eq @model.item_name\r
+ end\r
+ describe 'fieldsに於いて' do\r
+ before do\r
+ @fields = @my_local_manifest.fields\r
+ end\r
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。\r
+ it '数量が守られている' do\r
+ expect(@fields.size).to eq 5\r
+ end\r
+ end\r
+ describe 'field_namesに於いて' do\r
+ before do\r
+ @field_names = @my_local_manifest.field_names\r
+ end\r
+ it '数量が守られている' do\r
+ expect(@field_names.size).to eq 5\r
+ end\r
+ it '順序が守られている' do\r
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']\r
+ end\r
+ end\r
+ # 処理順に並べられたフィールドのこと\r
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。\r
+ describe 'ordered_fieldsに於いて' do\r
+ before do\r
+ @ordered_fields = @my_local_manifest.ordered_fields\r
+ @names = ['title', 'description', 'visible', 'id', 'author_id']\r
+ end\r
+ it 'これらのフィールドを取り扱う' do\r
+ expect(@ordered_fields.map {|f| f.name }).to eq @names\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @field = @ordered_fields[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'title'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'title'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ describe 'labelに於いて' do\r
+ before do\r
+ @label = @field.label\r
+ end\r
+ it 'defaultタイプである' do\r
+ expect(@label.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@label.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@label.form_name).to eq @model.item_name\r
+ expect(@label.field_name).to eq 'title'\r
+ expect(@label.model_name).to eq @model.item_name\r
+ expect(@label.column_name).to eq 'title'\r
+ end\r
+ end\r
+ describe 'tagに於いて' do\r
+ before do\r
+ @tag = @field.tag\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@tag.type).to eq 'text'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@tag.options).to_not be_empty\r
+ expect(@tag.options['size']).to eq 20\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@tag.form_name).to eq @model.item_name\r
+ expect(@tag.field_name).to eq 'title'\r
+ end\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @field = @ordered_fields[1]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'description'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'description'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @field = @ordered_fields[2]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'visible'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'visible'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'idに於いて' do\r
+ before do\r
+ @field = @ordered_fields[3]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'id'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'id'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @field = @ordered_fields[4]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'author_id'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'author_id'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'bucketに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.members).to be_empty\r
+ expect(@my_local_manifest.form_field_names).to be_empty\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_local_manifest.has_member?).to be false\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ end\r
+ \r
+end\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#コミック
+
+describe Comic do
+ include LocalManifestsMacros
+ before do
+ @model = Comic
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+# マニフェスト
+
+describe ComicStory do
+ include LocalManifestsMacros
+ before do
+ @model = ComicStory
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+# マニフェスト
+
+describe Folder do
+ include LocalManifestsMacros
+ before do
+ @model = Folder
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#色地
+
+describe GroundColor do
+ include LocalManifestsMacros
+ before do
+ @model = GroundColor
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#絵地
+
+describe GroundPicture do
+ include LocalManifestsMacros
+ before do
+ @model = GroundPicture
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#ライセンスグループ
+require 'spec_helper'
+
+describe LicenseGroup do
+ include LocalManifestsMacros
+ before do
+ @model = LicenseGroup
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#ライセンス
+require 'spec_helper'
+
+describe License do
+ include LocalManifestsMacros
+ before do
+ @model = License
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#原画ライセンスグループ
+require 'spec_helper'
+
+describe OriginalPictureLicenseGroup do
+ include LocalManifestsMacros
+ before do
+ @model = OriginalPictureLicenseGroup
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#原画
+require 'spec_helper'
+
+describe OriginalPicture do
+ include LocalManifestsMacros
+ before do
+ @model = OriginalPicture
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#コマ絵
+describe PanelPicture do
+ include LocalManifestsMacros
+ before do
+ @model = PanelPicture
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+require 'spec_helper'\r
+#コマ\r
+describe Panel do\r
+ include LocalManifestsMacros\r
+ before do\r
+ @model = Panel\r
+ end\r
+ \r
+ describe 'ファイラーに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_local_manifest.item_class).to eq @model\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ expect(@my_local_manifest.filer_name).to eq @model.item_name\r
+ end\r
+ describe 'symbolに於いて' do\r
+ before do\r
+ @symbol = @my_local_manifest.symbol\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@symbol.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@symbol.visible?).to be true\r
+ end\r
+ describe 'faceに於いて' do\r
+ before do\r
+ @face = @symbol.face\r
+ end\r
+ it 'imageタイプのfaceである' do\r
+ expect(@face.type).to eq 'image'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@face.url).to eq '/images/scroll.gif'\r
+ end\r
+ end\r
+ describe 'linkに於いて' do\r
+ before do\r
+ @link = @symbol.link\r
+ end\r
+ it 'actionタイプのlinkである' do\r
+ expect(@link.type).to eq 'action'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@link.action_name).to eq 'show'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@link.action_path).to eq '/scrolls/'\r
+ end\r
+ end\r
+ end\r
+ describe 'captionに於いて' do\r
+ before do\r
+ @caption = @my_local_manifest.caption\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@caption.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@caption.visible?).to be true\r
+ end\r
+ describe 'faceに於いて' do\r
+ before do\r
+ @face = @caption.face\r
+ end\r
+ it 'columnタイプのfaceである' do\r
+ expect(@face.type).to eq 'column'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@face.column_name).to eq 'title'\r
+ end\r
+ end\r
+ describe 'linkに於いて' do\r
+ before do\r
+ @link = @caption.link\r
+ end\r
+ it 'actionタイプのlinkである' do\r
+ expect(@link.type).to eq 'action'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@link.action_name).to eq 'play'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@link.action_path).to eq '/scrolls/play/'\r
+ end\r
+ end\r
+ end\r
+ describe 'summaryに於いて' do\r
+ before do\r
+ @summary = @my_local_manifest.summary\r
+ end\r
+ it 'templateタイプのsymbolである' do\r
+ expect(@summary.type).to eq 'template'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@summary.template_name).to eq 'summary'\r
+ end\r
+ end\r
+ describe 'iconに於いて' do\r
+ before do\r
+ @icon = @my_local_manifest.icon\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@icon.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@icon.visible?).to be true\r
+ end\r
+ end\r
+ describe 'dateに於いて' do\r
+ before do\r
+ @date = @my_local_manifest.date\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@date.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@date.visible?).to be true\r
+ end\r
+ end\r
+ describe 'editに於いて' do\r
+ before do\r
+ @edit = @my_local_manifest.edit\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@edit.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@edit.visible?).to be true\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'プロファイラーに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ describe 'columnsに於いて' do\r
+ before do\r
+ @columns = @my_local_manifest.columns\r
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']\r
+ end\r
+ it 'これらのカラムが定義されている' do\r
+ set_columns? @columns, @names\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @column = @columns['title']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @column = @columns['description']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @column = @columns['visible']\r
+ end\r
+ it 'sourceタイプのcolumnである' do\r
+ expect(@column.type).to eq 'source'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @column = @columns['author_id']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ end\r
+ describe 'column_namesに於いて' do\r
+ before do\r
+ @column_names = @my_local_manifest.column_names\r
+ end\r
+ it '数量が守られている' do\r
+ expect(@column_names.size).to eq 4 + 3\r
+ end\r
+ it '順序が守られている' do\r
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']\r
+ end\r
+ end\r
+ describe 'extend_settingsに於いて' do\r
+ before do\r
+ @extend_settings = @my_local_manifest.extend_settings\r
+ end\r
+ it '拡張カラムは無い' do\r
+ expect(@extend_settings).to be_empty\r
+ end\r
+ end\r
+ describe 'listsに於いて' do\r
+ before do\r
+ @lists = @my_local_manifest.lists\r
+ end\r
+ it '無い' do\r
+ expect(@lists).to be_empty\r
+ end\r
+ end\r
+ describe 'associationsに於いて' do\r
+ before do\r
+ @associations = @my_local_manifest.associations\r
+ end\r
+ describe 'belongs_toに於いて' do\r
+ before do\r
+ @belongs_to = @associations.belongs_to\r
+ end\r
+ it 'これらの所属モデルを取り扱う' do\r
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']\r
+ end\r
+ describe 'authorに於いて' do\r
+ before do\r
+ @mani = @belongs_to[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'author'\r
+ expect(@mani.model_name).to eq 'author'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq Author\r
+ end\r
+ end\r
+ end\r
+ describe 'has_manyに於いて' do\r
+ before do\r
+ @has_many = @associations.has_many\r
+ end\r
+ it 'これらの所持モデルを取り扱う' do\r
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']\r
+ end\r
+ describe 'scroll_panelsに於いて' do\r
+ before do\r
+ @mani = @has_many[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'\r
+ expect(@mani.model_name).to eq 'scroll_panel'\r
+ expect(@mani.list_name).to eq 'by_scroll'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq ScrollPanel\r
+ end\r
+ end\r
+ describe 'panels.by_scrollに於いて' do\r
+ before do\r
+ @mani = @has_many[1]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'panels.by_scroll'\r
+ expect(@mani.model_name).to eq 'panel'\r
+ expect(@mani.list_name).to eq 'by_scroll'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq Panel\r
+ end\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'リストグループに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ describe 'listsに於いて' do\r
+ before do\r
+ @lists = @my_local_manifest.lists\r
+ end\r
+ it 'これらのリストを定義している' do\r
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']\r
+ end\r
+ describe 'publicに於いて' do\r
+ before do\r
+ @mani = @lists['public']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.type).to eq 'public'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.model).to eq Scroll\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.has_id?).to be nil\r
+ expect(@mani.pre_id?).to be true\r
+ expect(@mani.item_name).to eq @model.item_name\r
+ end\r
+ describe 'whereに於いて' do\r
+ before do\r
+ @where = @mani.where\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@where.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@where.item_name).to eq @model.item_name\r
+ expect(@where.list_name).to eq 'public'\r
+ expect(@where.model).to eq Scroll\r
+ end\r
+ it 'method_name' do\r
+ expect(@where.method_name).to eq 'public_list_where'\r
+ end\r
+ end\r
+ describe 'includesに於いて' do\r
+ before do\r
+ @includes = @mani.includes\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@includes.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@includes.item_name).to eq @model.item_name\r
+ expect(@includes.list_name).to eq 'public'\r
+ expect(@includes.model).to eq Scroll\r
+ end\r
+ it 'includes' do\r
+ expect(@includes.includes).to be_empty\r
+ end\r
+ end\r
+ describe 'orderに於いて' do\r
+ before do\r
+ @order = @mani.order\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@order.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@order.item_name).to eq @model.item_name\r
+ expect(@order.list_name).to eq 'public'\r
+ expect(@order.model).to eq Scroll\r
+ end\r
+ it 'order' do\r
+ expect(@order.order).to eq 'list_order'\r
+ end\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe '入力フォームに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.name).to eq @model.item_name\r
+ end\r
+ describe 'fieldsに於いて' do\r
+ before do\r
+ @fields = @my_local_manifest.fields\r
+ end\r
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。\r
+ it '数量が守られている' do\r
+ expect(@fields.size).to eq 5\r
+ end\r
+ end\r
+ describe 'field_namesに於いて' do\r
+ before do\r
+ @field_names = @my_local_manifest.field_names\r
+ end\r
+ it '数量が守られている' do\r
+ expect(@field_names.size).to eq 5\r
+ end\r
+ it '順序が守られている' do\r
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']\r
+ end\r
+ end\r
+ # 処理順に並べられたフィールドのこと\r
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。\r
+ describe 'ordered_fieldsに於いて' do\r
+ before do\r
+ @ordered_fields = @my_local_manifest.ordered_fields\r
+ @names = ['title', 'description', 'visible', 'id', 'author_id']\r
+ end\r
+ it 'これらのフィールドを取り扱う' do\r
+ expect(@ordered_fields.map {|f| f.name }).to eq @names\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @field = @ordered_fields[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'title'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'title'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ describe 'labelに於いて' do\r
+ before do\r
+ @label = @field.label\r
+ end\r
+ it 'defaultタイプである' do\r
+ expect(@label.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@label.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@label.form_name).to eq @model.item_name\r
+ expect(@label.field_name).to eq 'title'\r
+ expect(@label.model_name).to eq @model.item_name\r
+ expect(@label.column_name).to eq 'title'\r
+ end\r
+ end\r
+ describe 'tagに於いて' do\r
+ before do\r
+ @tag = @field.tag\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@tag.type).to eq 'text'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@tag.options).to_not be_empty\r
+ expect(@tag.options['size']).to eq 20\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@tag.form_name).to eq @model.item_name\r
+ expect(@tag.field_name).to eq 'title'\r
+ end\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @field = @ordered_fields[1]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'description'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'description'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @field = @ordered_fields[2]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'visible'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'visible'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'idに於いて' do\r
+ before do\r
+ @field = @ordered_fields[3]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'id'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'id'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @field = @ordered_fields[4]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'author_id'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'author_id'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'bucketに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.members).to be_empty\r
+ expect(@my_local_manifest.form_field_names).to be_empty\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_local_manifest.has_member?).to be false\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ end\r
+ \r
+end\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+#実素材
+require 'spec_helper'
+
+describe Picture do
+ include LocalManifestsMacros
+ before do
+ @model = Picture
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+#素材\r
+require 'spec_helper'\r
+\r
+describe ResourcePicture do\r
+ include LocalManifestsMacros\r
+ before do\r
+ @model = ResourcePicture\r
+ end\r
+ \r
+ describe 'ファイラーに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_local_manifest.item_class).to eq @model\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ expect(@my_local_manifest.filer_name).to eq @model.item_name\r
+ end\r
+ describe 'symbolに於いて' do\r
+ before do\r
+ @symbol = @my_local_manifest.symbol\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@symbol.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@symbol.visible?).to be true\r
+ end\r
+ describe 'faceに於いて' do\r
+ before do\r
+ @face = @symbol.face\r
+ end\r
+ it 'imageタイプのfaceである' do\r
+ expect(@face.type).to eq 'image'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@face.url).to eq '/images/scroll.gif'\r
+ end\r
+ end\r
+ describe 'linkに於いて' do\r
+ before do\r
+ @link = @symbol.link\r
+ end\r
+ it 'actionタイプのlinkである' do\r
+ expect(@link.type).to eq 'action'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@link.action_name).to eq 'show'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@link.action_path).to eq '/scrolls/'\r
+ end\r
+ end\r
+ end\r
+ describe 'captionに於いて' do\r
+ before do\r
+ @caption = @my_local_manifest.caption\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@caption.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@caption.visible?).to be true\r
+ end\r
+ describe 'faceに於いて' do\r
+ before do\r
+ @face = @caption.face\r
+ end\r
+ it 'columnタイプのfaceである' do\r
+ expect(@face.type).to eq 'column'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@face.column_name).to eq 'title'\r
+ end\r
+ end\r
+ describe 'linkに於いて' do\r
+ before do\r
+ @link = @caption.link\r
+ end\r
+ it 'actionタイプのlinkである' do\r
+ expect(@link.type).to eq 'action'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@link.action_name).to eq 'play'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@link.action_path).to eq '/scrolls/play/'\r
+ end\r
+ end\r
+ end\r
+ describe 'summaryに於いて' do\r
+ before do\r
+ @summary = @my_local_manifest.summary\r
+ end\r
+ it 'templateタイプのsymbolである' do\r
+ expect(@summary.type).to eq 'template'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@summary.template_name).to eq 'summary'\r
+ end\r
+ end\r
+ describe 'iconに於いて' do\r
+ before do\r
+ @icon = @my_local_manifest.icon\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@icon.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@icon.visible?).to be true\r
+ end\r
+ end\r
+ describe 'dateに於いて' do\r
+ before do\r
+ @date = @my_local_manifest.date\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@date.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@date.visible?).to be true\r
+ end\r
+ end\r
+ describe 'editに於いて' do\r
+ before do\r
+ @edit = @my_local_manifest.edit\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@edit.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@edit.visible?).to be true\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'プロファイラーに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ describe 'columnsに於いて' do\r
+ before do\r
+ @columns = @my_local_manifest.columns\r
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']\r
+ end\r
+ it 'これらのカラムが定義されている' do\r
+ set_columns? @columns, @names\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @column = @columns['title']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @column = @columns['description']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @column = @columns['visible']\r
+ end\r
+ it 'sourceタイプのcolumnである' do\r
+ expect(@column.type).to eq 'source'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @column = @columns['author_id']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ end\r
+ describe 'column_namesに於いて' do\r
+ before do\r
+ @column_names = @my_local_manifest.column_names\r
+ end\r
+ it '数量が守られている' do\r
+ expect(@column_names.size).to eq 4 + 3\r
+ end\r
+ it '順序が守られている' do\r
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']\r
+ end\r
+ end\r
+ describe 'extend_settingsに於いて' do\r
+ before do\r
+ @extend_settings = @my_local_manifest.extend_settings\r
+ end\r
+ it '拡張カラムは無い' do\r
+ expect(@extend_settings).to be_empty\r
+ end\r
+ end\r
+ describe 'listsに於いて' do\r
+ before do\r
+ @lists = @my_local_manifest.lists\r
+ end\r
+ it '無い' do\r
+ expect(@lists).to be_empty\r
+ end\r
+ end\r
+ describe 'associationsに於いて' do\r
+ before do\r
+ @associations = @my_local_manifest.associations\r
+ end\r
+ describe 'belongs_toに於いて' do\r
+ before do\r
+ @belongs_to = @associations.belongs_to\r
+ end\r
+ it 'これらの所属モデルを取り扱う' do\r
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']\r
+ end\r
+ describe 'authorに於いて' do\r
+ before do\r
+ @mani = @belongs_to[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'author'\r
+ expect(@mani.model_name).to eq 'author'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq Author\r
+ end\r
+ end\r
+ end\r
+ describe 'has_manyに於いて' do\r
+ before do\r
+ @has_many = @associations.has_many\r
+ end\r
+ it 'これらの所持モデルを取り扱う' do\r
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']\r
+ end\r
+ describe 'scroll_panelsに於いて' do\r
+ before do\r
+ @mani = @has_many[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'\r
+ expect(@mani.model_name).to eq 'scroll_panel'\r
+ expect(@mani.list_name).to eq 'by_scroll'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq ScrollPanel\r
+ end\r
+ end\r
+ describe 'panels.by_scrollに於いて' do\r
+ before do\r
+ @mani = @has_many[1]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'panels.by_scroll'\r
+ expect(@mani.model_name).to eq 'panel'\r
+ expect(@mani.list_name).to eq 'by_scroll'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq Panel\r
+ end\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'リストグループに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ describe 'listsに於いて' do\r
+ before do\r
+ @lists = @my_local_manifest.lists\r
+ end\r
+ it 'これらのリストを定義している' do\r
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']\r
+ end\r
+ describe 'publicに於いて' do\r
+ before do\r
+ @mani = @lists['public']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.type).to eq 'public'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.model).to eq Scroll\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.has_id?).to be nil\r
+ expect(@mani.pre_id?).to be true\r
+ expect(@mani.item_name).to eq @model.item_name\r
+ end\r
+ describe 'whereに於いて' do\r
+ before do\r
+ @where = @mani.where\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@where.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@where.item_name).to eq @model.item_name\r
+ expect(@where.list_name).to eq 'public'\r
+ expect(@where.model).to eq Scroll\r
+ end\r
+ it 'method_name' do\r
+ expect(@where.method_name).to eq 'public_list_where'\r
+ end\r
+ end\r
+ describe 'includesに於いて' do\r
+ before do\r
+ @includes = @mani.includes\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@includes.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@includes.item_name).to eq @model.item_name\r
+ expect(@includes.list_name).to eq 'public'\r
+ expect(@includes.model).to eq Scroll\r
+ end\r
+ it 'includes' do\r
+ expect(@includes.includes).to be_empty\r
+ end\r
+ end\r
+ describe 'orderに於いて' do\r
+ before do\r
+ @order = @mani.order\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@order.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@order.item_name).to eq @model.item_name\r
+ expect(@order.list_name).to eq 'public'\r
+ expect(@order.model).to eq Scroll\r
+ end\r
+ it 'order' do\r
+ expect(@order.order).to eq 'list_order'\r
+ end\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe '入力フォームに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.name).to eq @model.item_name\r
+ end\r
+ describe 'fieldsに於いて' do\r
+ before do\r
+ @fields = @my_local_manifest.fields\r
+ end\r
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。\r
+ it '数量が守られている' do\r
+ expect(@fields.size).to eq 5\r
+ end\r
+ end\r
+ describe 'field_namesに於いて' do\r
+ before do\r
+ @field_names = @my_local_manifest.field_names\r
+ end\r
+ it '数量が守られている' do\r
+ expect(@field_names.size).to eq 5\r
+ end\r
+ it '順序が守られている' do\r
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']\r
+ end\r
+ end\r
+ # 処理順に並べられたフィールドのこと\r
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。\r
+ describe 'ordered_fieldsに於いて' do\r
+ before do\r
+ @ordered_fields = @my_local_manifest.ordered_fields\r
+ @names = ['title', 'description', 'visible', 'id', 'author_id']\r
+ end\r
+ it 'これらのフィールドを取り扱う' do\r
+ expect(@ordered_fields.map {|f| f.name }).to eq @names\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @field = @ordered_fields[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'title'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'title'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ describe 'labelに於いて' do\r
+ before do\r
+ @label = @field.label\r
+ end\r
+ it 'defaultタイプである' do\r
+ expect(@label.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@label.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@label.form_name).to eq @model.item_name\r
+ expect(@label.field_name).to eq 'title'\r
+ expect(@label.model_name).to eq @model.item_name\r
+ expect(@label.column_name).to eq 'title'\r
+ end\r
+ end\r
+ describe 'tagに於いて' do\r
+ before do\r
+ @tag = @field.tag\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@tag.type).to eq 'text'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@tag.options).to_not be_empty\r
+ expect(@tag.options['size']).to eq 20\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@tag.form_name).to eq @model.item_name\r
+ expect(@tag.field_name).to eq 'title'\r
+ end\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @field = @ordered_fields[1]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'description'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'description'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @field = @ordered_fields[2]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'visible'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'visible'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'idに於いて' do\r
+ before do\r
+ @field = @ordered_fields[3]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'id'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'id'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @field = @ordered_fields[4]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'author_id'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'author_id'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'bucketに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.members).to be_empty\r
+ expect(@my_local_manifest.form_field_names).to be_empty\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_local_manifest.has_member?).to be false\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ end\r
+ \r
+end\r
+\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#スクコマ
+describe ScrollPanel do
+ include LocalManifestsMacros
+ before do
+ @model = ScrollPanel
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#紙コマ
+describe SheetPanel do
+ include LocalManifestsMacros
+ before do
+ @model = SheetPanel
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#用紙
+
+describe Sheet do
+ include LocalManifestsMacros
+ before do
+ @model = Sheet
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#フキダシ
+
+describe SpeechBalloon do
+ include LocalManifestsMacros
+ before do
+ @model = SpeechBalloon
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#フキダシテンプレート
+describe SpeechBalloonTemplate do
+ include LocalManifestsMacros
+ before do
+ @model = SpeechBalloonTemplate
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+#セリフ\r
+require 'spec_helper'\r
+\r
+describe Speech do\r
+ include LocalManifestsMacros\r
+ before do\r
+ @model = Speech\r
+ end\r
+ \r
+ describe 'ファイラーに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_local_manifest.item_class).to eq @model\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ expect(@my_local_manifest.filer_name).to eq @model.item_name\r
+ end\r
+ describe 'symbolに於いて' do\r
+ before do\r
+ @symbol = @my_local_manifest.symbol\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@symbol.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@symbol.visible?).to be true\r
+ end\r
+ describe 'faceに於いて' do\r
+ before do\r
+ @face = @symbol.face\r
+ end\r
+ it 'imageタイプのfaceである' do\r
+ expect(@face.type).to eq 'image'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@face.url).to eq '/images/scroll.gif'\r
+ end\r
+ end\r
+ describe 'linkに於いて' do\r
+ before do\r
+ @link = @symbol.link\r
+ end\r
+ it 'actionタイプのlinkである' do\r
+ expect(@link.type).to eq 'action'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@link.action_name).to eq 'show'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@link.action_path).to eq '/scrolls/'\r
+ end\r
+ end\r
+ end\r
+ describe 'captionに於いて' do\r
+ before do\r
+ @caption = @my_local_manifest.caption\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@caption.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@caption.visible?).to be true\r
+ end\r
+ describe 'faceに於いて' do\r
+ before do\r
+ @face = @caption.face\r
+ end\r
+ it 'columnタイプのfaceである' do\r
+ expect(@face.type).to eq 'column'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@face.column_name).to eq 'title'\r
+ end\r
+ end\r
+ describe 'linkに於いて' do\r
+ before do\r
+ @link = @caption.link\r
+ end\r
+ it 'actionタイプのlinkである' do\r
+ expect(@link.type).to eq 'action'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@link.action_name).to eq 'play'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@link.action_path).to eq '/scrolls/play/'\r
+ end\r
+ end\r
+ end\r
+ describe 'summaryに於いて' do\r
+ before do\r
+ @summary = @my_local_manifest.summary\r
+ end\r
+ it 'templateタイプのsymbolである' do\r
+ expect(@summary.type).to eq 'template'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@summary.template_name).to eq 'summary'\r
+ end\r
+ end\r
+ describe 'iconに於いて' do\r
+ before do\r
+ @icon = @my_local_manifest.icon\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@icon.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@icon.visible?).to be true\r
+ end\r
+ end\r
+ describe 'dateに於いて' do\r
+ before do\r
+ @date = @my_local_manifest.date\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@date.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@date.visible?).to be true\r
+ end\r
+ end\r
+ describe 'editに於いて' do\r
+ before do\r
+ @edit = @my_local_manifest.edit\r
+ end\r
+ it 'defaultタイプのsymbolである' do\r
+ expect(@edit.type).to eq 'default'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@edit.visible?).to be true\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'プロファイラーに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ describe 'columnsに於いて' do\r
+ before do\r
+ @columns = @my_local_manifest.columns\r
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']\r
+ end\r
+ it 'これらのカラムが定義されている' do\r
+ set_columns? @columns, @names\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @column = @columns['title']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @column = @columns['description']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @column = @columns['visible']\r
+ end\r
+ it 'sourceタイプのcolumnである' do\r
+ expect(@column.type).to eq 'source'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @column = @columns['author_id']\r
+ end\r
+ it 'defaultタイプのcolumnである' do\r
+ expect(@column.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@column.item_name).to eq 'scroll'\r
+ end\r
+ end\r
+ end\r
+ describe 'column_namesに於いて' do\r
+ before do\r
+ @column_names = @my_local_manifest.column_names\r
+ end\r
+ it '数量が守られている' do\r
+ expect(@column_names.size).to eq 4 + 3\r
+ end\r
+ it '順序が守られている' do\r
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']\r
+ end\r
+ end\r
+ describe 'extend_settingsに於いて' do\r
+ before do\r
+ @extend_settings = @my_local_manifest.extend_settings\r
+ end\r
+ it '拡張カラムは無い' do\r
+ expect(@extend_settings).to be_empty\r
+ end\r
+ end\r
+ describe 'listsに於いて' do\r
+ before do\r
+ @lists = @my_local_manifest.lists\r
+ end\r
+ it '無い' do\r
+ expect(@lists).to be_empty\r
+ end\r
+ end\r
+ describe 'associationsに於いて' do\r
+ before do\r
+ @associations = @my_local_manifest.associations\r
+ end\r
+ describe 'belongs_toに於いて' do\r
+ before do\r
+ @belongs_to = @associations.belongs_to\r
+ end\r
+ it 'これらの所属モデルを取り扱う' do\r
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']\r
+ end\r
+ describe 'authorに於いて' do\r
+ before do\r
+ @mani = @belongs_to[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'author'\r
+ expect(@mani.model_name).to eq 'author'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq Author\r
+ end\r
+ end\r
+ end\r
+ describe 'has_manyに於いて' do\r
+ before do\r
+ @has_many = @associations.has_many\r
+ end\r
+ it 'これらの所持モデルを取り扱う' do\r
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']\r
+ end\r
+ describe 'scroll_panelsに於いて' do\r
+ before do\r
+ @mani = @has_many[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'\r
+ expect(@mani.model_name).to eq 'scroll_panel'\r
+ expect(@mani.list_name).to eq 'by_scroll'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq ScrollPanel\r
+ end\r
+ end\r
+ describe 'panels.by_scrollに於いて' do\r
+ before do\r
+ @mani = @has_many[1]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.name).to eq 'panels.by_scroll'\r
+ expect(@mani.model_name).to eq 'panel'\r
+ expect(@mani.list_name).to eq 'by_scroll'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.model).to eq Panel\r
+ end\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'リストグループに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ describe 'listsに於いて' do\r
+ before do\r
+ @lists = @my_local_manifest.lists\r
+ end\r
+ it 'これらのリストを定義している' do\r
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']\r
+ end\r
+ describe 'publicに於いて' do\r
+ before do\r
+ @mani = @lists['public']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.type).to eq 'public'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@mani.model).to eq Scroll\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@mani.has_id?).to be nil\r
+ expect(@mani.pre_id?).to be true\r
+ expect(@mani.item_name).to eq @model.item_name\r
+ end\r
+ describe 'whereに於いて' do\r
+ before do\r
+ @where = @mani.where\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@where.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@where.item_name).to eq @model.item_name\r
+ expect(@where.list_name).to eq 'public'\r
+ expect(@where.model).to eq Scroll\r
+ end\r
+ it 'method_name' do\r
+ expect(@where.method_name).to eq 'public_list_where'\r
+ end\r
+ end\r
+ describe 'includesに於いて' do\r
+ before do\r
+ @includes = @mani.includes\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@includes.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@includes.item_name).to eq @model.item_name\r
+ expect(@includes.list_name).to eq 'public'\r
+ expect(@includes.model).to eq Scroll\r
+ end\r
+ it 'includes' do\r
+ expect(@includes.includes).to be_empty\r
+ end\r
+ end\r
+ describe 'orderに於いて' do\r
+ before do\r
+ @order = @mani.order\r
+ end\r
+ it 'autoタイプである' do\r
+ expect(@order.type).to eq 'auto'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@order.item_name).to eq @model.item_name\r
+ expect(@order.list_name).to eq 'public'\r
+ expect(@order.model).to eq Scroll\r
+ end\r
+ it 'order' do\r
+ expect(@order.order).to eq 'list_order'\r
+ end\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe '入力フォームに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.name).to eq @model.item_name\r
+ end\r
+ describe 'fieldsに於いて' do\r
+ before do\r
+ @fields = @my_local_manifest.fields\r
+ end\r
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。\r
+ it '数量が守られている' do\r
+ expect(@fields.size).to eq 5\r
+ end\r
+ end\r
+ describe 'field_namesに於いて' do\r
+ before do\r
+ @field_names = @my_local_manifest.field_names\r
+ end\r
+ it '数量が守られている' do\r
+ expect(@field_names.size).to eq 5\r
+ end\r
+ it '順序が守られている' do\r
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']\r
+ end\r
+ end\r
+ # 処理順に並べられたフィールドのこと\r
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。\r
+ describe 'ordered_fieldsに於いて' do\r
+ before do\r
+ @ordered_fields = @my_local_manifest.ordered_fields\r
+ @names = ['title', 'description', 'visible', 'id', 'author_id']\r
+ end\r
+ it 'これらのフィールドを取り扱う' do\r
+ expect(@ordered_fields.map {|f| f.name }).to eq @names\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @field = @ordered_fields[0]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'title'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'title'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ describe 'labelに於いて' do\r
+ before do\r
+ @label = @field.label\r
+ end\r
+ it 'defaultタイプである' do\r
+ expect(@label.type).to eq 'default'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@label.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@label.form_name).to eq @model.item_name\r
+ expect(@label.field_name).to eq 'title'\r
+ expect(@label.model_name).to eq @model.item_name\r
+ expect(@label.column_name).to eq 'title'\r
+ end\r
+ end\r
+ describe 'tagに於いて' do\r
+ before do\r
+ @tag = @field.tag\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@tag.type).to eq 'text'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@tag.options).to_not be_empty\r
+ expect(@tag.options['size']).to eq 20\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@tag.form_name).to eq @model.item_name\r
+ expect(@tag.field_name).to eq 'title'\r
+ end\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @field = @ordered_fields[1]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'description'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'description'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @field = @ordered_fields[2]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'visible'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'visible'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'idに於いて' do\r
+ before do\r
+ @field = @ordered_fields[3]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'id'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'id'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @field = @ordered_fields[4]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@field.name).to eq 'author_id'\r
+ expect(@field.row_break).to be true\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@field.part?).to be false\r
+ expect(@field.form_name).to eq @model.item_name\r
+ expect(@field.column_name).to eq 'author_id'\r
+ expect(@field.model_name).to eq @model.item_name\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'bucketに於いて' do\r
+ before do\r
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ expect(@my_local_manifest.members).to be_empty\r
+ expect(@my_local_manifest.form_field_names).to be_empty\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_local_manifest.has_member?).to be false\r
+ expect(@my_local_manifest.item_name).to eq @model.item_name\r
+ end\r
+ end\r
+ \r
+end\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#スト紙
+describe StorySheet do
+ include LocalManifestsMacros
+ before do
+ @model = StorySheet
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#ストーリー
+
+describe Story do
+ include LocalManifestsMacros
+ before do
+ @model = Story
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#システム画像
+describe SystemPicture do
+ include LocalManifestsMacros
+ before do
+ @model = SystemPicture
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#スクロールマニフェスト
+
+describe WritingFormat do
+ include LocalManifestsMacros
+ before do
+ @model = WritingFormat
+ end
+
+ describe 'ファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.item_class).to eq @model
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ expect(@my_local_manifest.filer_name).to eq @model.item_name
+ end
+ describe 'symbolに於いて' do
+ before do
+ @symbol = @my_local_manifest.symbol
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@symbol.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@symbol.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @symbol.face
+ end
+ it 'imageタイプのfaceである' do
+ expect(@face.type).to eq 'image'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.url).to eq '/images/scroll.gif'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @symbol.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'show'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/'
+ end
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @caption = @my_local_manifest.caption
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@caption.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@caption.visible?).to be true
+ end
+ describe 'faceに於いて' do
+ before do
+ @face = @caption.face
+ end
+ it 'columnタイプのfaceである' do
+ expect(@face.type).to eq 'column'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@face.column_name).to eq 'title'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @link = @caption.link
+ end
+ it 'actionタイプのlinkである' do
+ expect(@link.type).to eq 'action'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@link.action_name).to eq 'play'
+ end
+ it 'サポート機能が動作している' do
+ expect(@link.action_path).to eq '/scrolls/play/'
+ end
+ end
+ end
+ describe 'summaryに於いて' do
+ before do
+ @summary = @my_local_manifest.summary
+ end
+ it 'templateタイプのsymbolである' do
+ expect(@summary.type).to eq 'template'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@summary.template_name).to eq 'summary'
+ end
+ end
+ describe 'iconに於いて' do
+ before do
+ @icon = @my_local_manifest.icon
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@icon.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@icon.visible?).to be true
+ end
+ end
+ describe 'dateに於いて' do
+ before do
+ @date = @my_local_manifest.date
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@date.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@date.visible?).to be true
+ end
+ end
+ describe 'editに於いて' do
+ before do
+ @edit = @my_local_manifest.edit
+ end
+ it 'defaultタイプのsymbolである' do
+ expect(@edit.type).to eq 'default'
+ end
+ it 'サポート機能が動作している' do
+ expect(@edit.visible?).to be true
+ end
+ end
+ end
+
+ describe 'プロファイラーに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'columnsに於いて' do
+ before do
+ @columns = @my_local_manifest.columns
+ @names = ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ it 'これらのカラムが定義されている' do
+ set_columns? @columns, @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @column = @columns['title']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @column = @columns['description']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @column = @columns['visible']
+ end
+ it 'sourceタイプのcolumnである' do
+ expect(@column.type).to eq 'source'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @column = @columns['author_id']
+ end
+ it 'defaultタイプのcolumnである' do
+ expect(@column.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@column.item_name).to eq 'scroll'
+ end
+ end
+ end
+ describe 'column_namesに於いて' do
+ before do
+ @column_names = @my_local_manifest.column_names
+ end
+ it '数量が守られている' do
+ expect(@column_names.size).to eq 4 + 3
+ end
+ it '順序が守られている' do
+ expect(@column_names).to eq ['id', 'title', 'description', 'visible', 'author_id', 'created_at', 'updated_at']
+ end
+ end
+ describe 'extend_settingsに於いて' do
+ before do
+ @extend_settings = @my_local_manifest.extend_settings
+ end
+ it '拡張カラムは無い' do
+ expect(@extend_settings).to be_empty
+ end
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it '無い' do
+ expect(@lists).to be_empty
+ end
+ end
+ describe 'associationsに於いて' do
+ before do
+ @associations = @my_local_manifest.associations
+ end
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @associations.belongs_to
+ end
+ it 'これらの所属モデルを取り扱う' do
+ expect(@belongs_to.map {|a| a.name}).to eq ['author']
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'author'
+ expect(@mani.model_name).to eq 'author'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @associations.has_many
+ end
+ it 'これらの所持モデルを取り扱う' do
+ expect(@has_many.map {|a| a.table_name}).to eq ['scroll_panels', 'panels']
+ end
+ describe 'scroll_panelsに於いて' do
+ before do
+ @mani = @has_many[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'scroll_panels.by_scroll'
+ expect(@mani.model_name).to eq 'scroll_panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panels.by_scrollに於いて' do
+ before do
+ @mani = @has_many[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.name).to eq 'panels.by_scroll'
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.list_name).to eq 'by_scroll'
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+ end
+
+ describe 'リストグループに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ describe 'listsに於いて' do
+ before do
+ @lists = @my_local_manifest.lists
+ end
+ it 'これらのリストを定義している' do
+ set_lists? @lists, ['public', 'private', 'by_author', 'by_panel']
+ end
+ describe 'publicに於いて' do
+ before do
+ @mani = @lists['public']
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.type).to eq 'public'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@mani.model).to eq Scroll
+ end
+ it 'サポート機能が動作している' do
+ expect(@mani.has_id?).to be nil
+ expect(@mani.pre_id?).to be true
+ expect(@mani.item_name).to eq @model.item_name
+ end
+ describe 'whereに於いて' do
+ before do
+ @where = @mani.where
+ end
+ it 'autoタイプである' do
+ expect(@where.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@where.item_name).to eq @model.item_name
+ expect(@where.list_name).to eq 'public'
+ expect(@where.model).to eq Scroll
+ end
+ it 'method_name' do
+ expect(@where.method_name).to eq 'public_list_where'
+ end
+ end
+ describe 'includesに於いて' do
+ before do
+ @includes = @mani.includes
+ end
+ it 'autoタイプである' do
+ expect(@includes.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@includes.item_name).to eq @model.item_name
+ expect(@includes.list_name).to eq 'public'
+ expect(@includes.model).to eq Scroll
+ end
+ it 'includes' do
+ expect(@includes.includes).to be_empty
+ end
+ end
+ describe 'orderに於いて' do
+ before do
+ @order = @mani.order
+ end
+ it 'autoタイプである' do
+ expect(@order.type).to eq 'auto'
+ end
+ it 'サポート機能が動作している' do
+ expect(@order.item_name).to eq @model.item_name
+ expect(@order.list_name).to eq 'public'
+ expect(@order.model).to eq Scroll
+ end
+ it 'order' do
+ expect(@order.order).to eq 'list_order'
+ end
+ end
+ end
+ end
+ end
+
+ describe '入力フォームに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.name).to eq @model.item_name
+ end
+ describe 'fieldsに於いて' do
+ before do
+ @fields = @my_local_manifest.fields
+ end
+ # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
+ it '数量が守られている' do
+ expect(@fields.size).to eq 5
+ end
+ end
+ describe 'field_namesに於いて' do
+ before do
+ @field_names = @my_local_manifest.field_names
+ end
+ it '数量が守られている' do
+ expect(@field_names.size).to eq 5
+ end
+ it '順序が守られている' do
+ expect(@field_names).to eq ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ end
+ # 処理順に並べられたフィールドのこと
+ # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
+ describe 'ordered_fieldsに於いて' do
+ before do
+ @ordered_fields = @my_local_manifest.ordered_fields
+ @names = ['title', 'description', 'visible', 'id', 'author_id']
+ end
+ it 'これらのフィールドを取り扱う' do
+ expect(@ordered_fields.map {|f| f.name }).to eq @names
+ end
+ describe 'titleに於いて' do
+ before do
+ @field = @ordered_fields[0]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'title'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'title'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ describe 'labelに於いて' do
+ before do
+ @label = @field.label
+ end
+ it 'defaultタイプである' do
+ expect(@label.type).to eq 'default'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@label.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@label.form_name).to eq @model.item_name
+ expect(@label.field_name).to eq 'title'
+ expect(@label.model_name).to eq @model.item_name
+ expect(@label.column_name).to eq 'title'
+ end
+ end
+ describe 'tagに於いて' do
+ before do
+ @tag = @field.tag
+ end
+ it 'textタイプである' do
+ expect(@tag.type).to eq 'text'
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@tag.options).to_not be_empty
+ expect(@tag.options['size']).to eq 20
+ end
+ it 'サポート機能が動作している' do
+ expect(@tag.form_name).to eq @model.item_name
+ expect(@tag.field_name).to eq 'title'
+ end
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @field = @ordered_fields[1]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'description'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'description'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @field = @ordered_fields[2]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'visible'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'visible'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'idに於いて' do
+ before do
+ @field = @ordered_fields[3]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @field = @ordered_fields[4]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@field.name).to eq 'author_id'
+ expect(@field.row_break).to be true
+ end
+ it 'サポート機能が動作している' do
+ expect(@field.part?).to be false
+ expect(@field.form_name).to eq @model.item_name
+ expect(@field.column_name).to eq 'author_id'
+ expect(@field.model_name).to eq @model.item_name
+ end
+ end
+ end
+ end
+
+ describe 'bucketに於いて' do
+ before do
+ @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
+ end
+ it 'マニフェストから設定を取り出している' do
+ expect(@my_local_manifest.members).to be_empty
+ expect(@my_local_manifest.form_field_names).to be_empty
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_local_manifest.has_member?).to be false
+ expect(@my_local_manifest.item_name).to eq @model.item_name
+ end
+ end
+
+end
--- /dev/null
+rspec --drb C:/Sites/ss/spec/manifests/artist_spec.rb C:/Sites/ss/spec/manifests/author_spec.rb C:/Sites/ss/spec/manifests/balloon_spec.rb C:/Sites/ss/spec/manifests/comic_spec.rb C:/Sites/ss/spec/manifests/comic_story_spec.rb C:/Sites/ss/spec/manifests/folder_spec.rb C:/Sites/ss/spec/manifests/ground_color_spec.rb C:/Sites/ss/spec/manifests/ground_picture_spec.rb C:/Sites/ss/spec/manifests/license_group_spec.rb C:/Sites/ss/spec/manifests/license_spec.rb C:/Sites/ss/spec/manifests/original_picture_license_group_spec.rb C:/Sites/ss/spec/manifests/original_picture_spec.rb C:/Sites/ss/spec/manifests/panel_picture_spec.rb C:/Sites/ss/spec/manifests/panel_spec.rb C:/Sites/ss/spec/manifests/picture_spec.rb C:/Sites/ss/spec/manifests/resource_picture_spec.rb C:/Sites/ss/spec/manifests/scroll_panel_spec.rb C:/Sites/ss/spec/manifests/scroll_spec.rb C:/Sites/ss/spec/manifests/sheet_panel_spec.rb C:/Sites/ss/spec/manifests/sheet_spec.rb C:/Sites/ss/spec/manifests/speech_balloon_spec.rb C:/Sites/ss/spec/manifests/speech_balloon_template_spec.rb C:/Sites/ss/spec/manifests/speech_spec.rb C:/Sites/ss/spec/manifests/story_sheet_spec.rb C:/Sites/ss/spec/manifests/story_spec.rb C:/Sites/ss/spec/manifests/system_picture_spec.rb C:/Sites/ss/spec/manifests/writing_format_spec.rb\r
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+fs = Dir.glob(File.dirname(__FILE__) + '/manifests/*_spec.rb').map {|f| f }.join(' ')\r
+puts 'rspec --drb ' + fs\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+#絵師
+require 'spec_helper'
+
+describe Artist do
+ include ManifestsMacros
+ before do
+ @model = Artist
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'オーナーである' do
+ expect(@model.ancestors.include?(Peta::Owner)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it '絵師のためのコントローラである' do
+ expect(@model.item_name).to eq 'artist'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'show',
+ 'count',
+ 'new', 'edit', 'create', 'update', 'destroy']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # 絵師の公開リストを返すように定義している
+ set_list_action? @action, 'artist', 'public'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #絵師の公開リストのカウントを返すように定義している
+ set_list_action? @action, 'artist', 'public'
+ 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 'artist'
+ 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 'artist'
+ 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 'artist'
+ 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 'artist'
+ 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 'artist'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'artist'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'artists'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = []
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @model.my_manifest.associations.has_many
+ @names = ['resource_pictures']
+ end
+ it 'これらのモデルを所持している' do
+ set_associations? @has_many, @names
+ end
+ describe 'resource_picturesに於いて' do
+ before do
+ @mani = @has_many['resource_pictures']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'resource_picture'
+ expect(@mani.foreign_key).to eq 'artist_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ResourcePicture
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'name', 'user_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'nameに於いて' do
+ before do
+ @attribute = @attributes['name']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'user_idに於いて' do
+ before do
+ @attribute = @attributes['user_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#作家
+require 'spec_helper'
+
+describe Author do
+ include ManifestsMacros
+ before do
+ @model = Author
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'オーナーである' do
+ expect(@model.ancestors.include?(Peta::Owner)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it '作家のためのコントローラである' do
+ expect(@model.item_name).to eq 'author'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'show',
+ 'count',
+ 'new', 'edit', 'create', 'update', 'destroy']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # 作家の公開リストを返すように定義している
+ set_list_action? @action, 'author', 'public'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #作家の公開リストのカウントを返すように定義している
+ set_list_action? @action, 'author', 'public'
+ 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 'author'
+ 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 'author'
+ 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 'author'
+ 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 'author'
+ 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 'author'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'author'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'authors'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = []
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @model.my_manifest.associations.has_many
+ @names = ['scrolls', 'comics', 'stories', 'sheets', 'panels']
+ end
+ it 'これらのモデルを所持している' do
+ set_associations? @has_many, @names
+ end
+ describe 'scrollsに於いて' do
+ before do
+ @mani = @has_many['scrolls']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'scroll'
+ expect(@mani.foreign_key).to eq 'author_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq Scroll
+ end
+ end
+ describe 'comicsに於いて' do
+ before do
+ @mani = @has_many['comics']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'comic'
+ expect(@mani.foreign_key).to eq 'author_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq Comic
+ end
+ end
+ describe 'storiesに於いて' do
+ before do
+ @mani = @has_many['stories']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'story'
+ expect(@mani.foreign_key).to eq 'author_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq Story
+ end
+ end
+ describe 'sheetsに於いて' do
+ before do
+ @mani = @has_many['sheets']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'sheet'
+ expect(@mani.foreign_key).to eq 'author_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq Sheet
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.foreign_key).to eq 'author_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'name', 'user_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'nameに於いて' do
+ before do
+ @attribute = @attributes['name']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['user_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+require 'spec_helper'\r
+#フキダシ枠\r
+describe Balloon do\r
+ include ManifestsMacros\r
+ before do\r
+ @model = Balloon\r
+ end\r
+ \r
+ describe 'ペタナイズに於いて' do\r
+ it 'スクコマを閉じるためのバインダーである' do\r
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+ describe 'コントローラに於いて' do\r
+ before do\r
+ @controller = @model.my_controller\r
+ end\r
+ it 'スクロールのためのコントローラである' do\r
+ expect(@model.item_name).to eq 'scroll'\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
+ end\r
+ it 'これらのアクションが定義されている' do\r
+ set_actions? @actions, @actions_names\r
+ end\r
+ describe 'baseに於いて' do\r
+ end\r
+ describe 'indexに於いて' do\r
+ before do\r
+ @action = @actions['index']\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', 'public'\r
+ end\r
+ end\r
+ describe 'by_authorに於いて' do\r
+ before do\r
+ @action = @actions['by_author']\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
+ 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
+ end\r
+ end\r
+ describe 'countに於いて' do\r
+ before do\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', 'public'\r
+ end\r
+ end\r
+ describe 'count_by_authorに於いて' do\r
+ before do\r
+ @action = @actions['count_by_author']\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_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
+ 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
+ end\r
+ end\r
+ describe 'editに於いて' 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
+ 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
+ end\r
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+ describe 'モデルに於いて' do\r
+ before do\r
+ @my_manifest = @model.my_manifest\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_manifest.model_name).to eq 'scroll'\r
+ expect(@my_manifest.classify).to eq @model\r
+ expect(@my_manifest.table_name).to eq 'scrolls'\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
+ end\r
+ it 'これらのモデルに所属している' do\r
+ set_associations? @belongs_to, @names\r
+ end\r
+ describe 'authorに於いて' do\r
+ before do\r
+ @mani = @belongs_to['author']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'author'\r
+ expect(@mani.id_column).to eq 'author_id'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq Author\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
+ before do\r
+ @mani = @has_many['scroll_panels']\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
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq ScrollPanel\r
+ end\r
+ end\r
+ describe 'panelsに於いて' do\r
+ before do\r
+ @mani = @has_many['panels']\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
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be true\r
+ expect(@mani.model).to eq Panel\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'attributesに於いて' do\r
+ before do\r
+ @attributes = @model.my_manifest.attributes\r
+ end\r
+ it 'これらのカラムを定義している' do\r
+ set_attributes? @attributes, \r
+ ['id', 'title', 'description', 'visible', 'author_id', \r
+ 'created_at', 'updated_at']\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @attribute = @attributes['title']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @attribute = @attributes['description']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @attribute = @attributes['visible']\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
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['author_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+end\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#コミック
+
+describe Comic do
+ include ManifestsMacros
+ before do
+ @model = Comic
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'コミストを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'コミックのためのコントローラである' do
+ expect(@model.item_name).to eq 'comic'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_author', 'by_story', 'play', 'show',
+ 'count', 'count_by_author', 'count_by_story',
+ 'new', 'edit', 'create', 'update', 'destroy']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コミックの公開リストを返すように定義している
+ set_list_action? @action, 'comic', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コミックの作家フィルタリストを返すように定義している
+ set_list_action? @action, 'comic', 'by_author'
+ end
+ end
+ describe 'by_storyに於いて' do
+ before do
+ @action = @actions['by_story']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #コミックのコマフィルタリストを返すように定義している
+ set_list_action? @action, 'comic', 'by_story'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #コミックの公開リストのカウントを返すように定義している
+ set_list_action? @action, 'comic', '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, 'comic', 'by_author'
+ end
+ end
+ describe 'count_by_storyに於いて' do
+ before do
+ @action = @actions['count_by_story']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コミックのコマフィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'comic', 'by_story'
+ 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 'comic'
+ 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 'comic'
+ 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 'comic'
+ 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 'comic'
+ 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 'comic'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'comic'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'comics'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @model.my_manifest.associations.has_many
+ @names = ['comic_stories', 'stories']
+ end
+ it 'これらのモデルを所持している' do
+ set_associations? @has_many, @names
+ end
+ describe 'comic_storiesに於いて' do
+ before do
+ @mani = @has_many['comic_stories']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'comic_story'
+ expect(@mani.foreign_key).to eq 'comic_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ComicStory
+ end
+ end
+ describe 'storiesに於いて' do
+ before do
+ @mani = @has_many['stories']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'story'
+ expect(@mani.foreign_key).to eq 'comic_id'
+ expect(@mani.through).to eq 'comic_stories'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Story
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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 'comic_visible_items'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+# コミスト
+
+describe ComicStory do
+ include ManifestsMacros
+ before do
+ @model = ComicStory
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'コミックにストーリーを差し込むためのリーフである' do
+ expect(@model.ancestors.include?(Peta::Leaf)).to eq true
+ end
+ it '親モデルはコミックである' do
+ expect(@model.my_peta.parent_model_name).to eq 'comic'
+ end
+ describe 'ブーストに於いて' do
+ it '特筆すべき注意事項はない' do
+ expect(@model.my_peta.boost.keys).to be_empty
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'コミストのためのコントローラである' do
+ expect(@model.item_name).to eq 'comic_story'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_comic', 'by_story', 'show',
+ 'count', 'count_by_comic', 'count_by_story',
+ 'new', 'edit', 'create', 'update', 'destroy']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コミストの公開リストを返すように定義している
+ set_list_action? @action, 'comic_story', 'public'
+ end
+ end
+ describe 'by_comicに於いて' do
+ before do
+ @action = @actions['by_comic']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コミストの作家フィルタリストを返すように定義している
+ set_list_action? @action, 'comic_story', 'by_comic'
+ end
+ end
+ describe 'by_storyに於いて' do
+ before do
+ @action = @actions['by_story']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #コミストのコマフィルタリストを返すように定義している
+ set_list_action? @action, 'comic_story', 'by_story'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #コミストの公開リストのカウントを返すように定義している
+ set_list_action? @action, 'comic_story', 'public'
+ end
+ end
+ describe 'count_by_comicに於いて' do
+ before do
+ @action = @actions['count_by_comic']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コミストの作家フィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'comic_story', 'by_comic'
+ end
+ end
+ describe 'count_by_storyに於いて' do
+ before do
+ @action = @actions['count_by_story']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コミストのコマフィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'comic_story', 'by_story'
+ 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 'comic_story'
+ 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 'comic_story'
+ 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 'comic_story'
+ 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 'comic_story'
+ 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 'comic_story'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'comic_story'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'comic_stories'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['comic', 'story']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'comicに於いて' do
+ before do
+ @mani = @belongs_to['comic']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'comic'
+ expect(@mani.id_column).to eq 'comic_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Comic
+ end
+ end
+ describe 'storyに於いて' do
+ before do
+ @mani = @belongs_to['story']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'story'
+ expect(@mani.id_column).to eq 'story_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Story
+ 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
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'comic_id', 'story_id', 't',
+ 'created_at', 'updated_at']
+ end
+ describe 'comic_idに於いて' do
+ before do
+ @attribute = @attributes['comic_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'story_idに於いて' do
+ before do
+ @attribute = @attributes['story_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+# フォルダ
+
+describe Folder do
+ include ManifestsMacros
+ before do
+ @model = Folder
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'アイテムである' do
+ expect(@model.ancestors.include?(Peta::Item)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'フォルダのためのコントローラである' do
+ expect(@model.item_name).to eq 'folder'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['root', 'index', 'show',
+ 'count',
+ 'new', 'edit', 'destroy']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'rootに於いて' do
+ before do
+ @action = @actions['root']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # フォルダの公開リストを返すように定義している
+ set_list_action? @action, 'folder', 'public'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #フォルダの公開リストのカウントを返すように定義している
+ set_list_action? @action, 'folder', 'public'
+ 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 'folder'
+ 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 'folder'
+ 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 'folder'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'folder'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'folders'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = []
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ 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
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'name', 'controller_name', 'action_name', 'category_id',
+ 't', 'parent_id', 'lft', 'rgt', 'depth',
+ 'created_at', 'updated_at']
+ end
+ describe 'nameに於いて' do
+ before do
+ @attribute = @attributes['name']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'controller_nameに於いて' do
+ before do
+ @attribute = @attributes['controller_name']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'action_nameに於いて' do
+ before do
+ @attribute = @attributes['action_name']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'category_idに於いて' do
+ before do
+ @attribute = @attributes['category_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'parent_idに於いて' do
+ before do
+ @attribute = @attributes['parent_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'lftに於いて' do
+ before do
+ @attribute = @attributes['lft']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'rgtに於いて' do
+ before do
+ @attribute = @attributes['rgt']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'depthに於いて' do
+ before do
+ @attribute = @attributes['depth']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#色地
+
+describe GroundColor do
+ include ManifestsMacros
+ before do
+ @model = GroundColor
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'パネルの要素として利用されるエレメントである' do
+ expect(@model.ancestors.include?(Peta::Element)).to eq true
+ end
+ it '親モデルはパネルである' do
+ expect(@model.my_peta.parent_model_name).to eq 'panel'
+ end
+ describe 'ブーストに於いて' do
+ it '特筆すべき注意事項はない' do
+ expect(@model.my_peta.boost.keys).to be_empty
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it '色地のためのコントローラである' do
+ expect(@model.item_name).to eq 'ground_color'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_author', 'by_panel', 'show',
+ 'count', 'count_by_author', 'count_by_panel',
+ 'new', 'edit']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # 絵地の公開リストを返すように定義している
+ set_list_action? @action, 'ground_color', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # 絵地の作家フィルタリストを返すように定義している
+ set_list_action? @action, 'ground_color', '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, 'ground_color', 'by_panel'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #絵地の公開リストのカウントを返すように定義している
+ set_list_action? @action, 'ground_color', '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, 'ground_color', '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, 'ground_color', '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 'ground_color'
+ 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 'ground_color'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'ground_color'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'ground_colors'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['panel']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'panelに於いて' do
+ before do
+ @mani = @belongs_to['panel']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.id_column).to eq 'panel_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Panel
+ 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
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'panel_id', 'caption', 'code', 'orientation', 'xy', 'wh',
+ 'z', 't',
+ 'created_at', 'updated_at']
+ end
+ describe 'panel_idに於いて' do
+ before do
+ @attribute = @attributes['panel_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @attribute = @attributes['caption']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'codeに於いて' do
+ before do
+ @attribute = @attributes['code']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'orientationに於いて' do
+ before do
+ @attribute = @attributes['orientation']
+ 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 'ground_color_orientation_items'
+ end
+ end
+ describe 'xyに於いて' do
+ before do
+ @attribute = @attributes['xy']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'whに於いて' do
+ before do
+ @attribute = @attributes['wh']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'zに於いて' do
+ before do
+ @attribute = @attributes['z']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#絵地
+
+describe GroundPicture do
+ include ManifestsMacros
+ before do
+ @model = GroundPicture
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'パネルの要素として利用されるエレメントである' do
+ expect(@model.ancestors.include?(Peta::Element)).to eq true
+ end
+ it '親モデルはパネルである' do
+ expect(@model.my_peta.parent_model_name).to eq 'panel'
+ end
+ describe 'ブーストに於いて' do
+ it '特筆すべき注意事項はない' do
+ expect(@model.my_peta.boost.keys).to be_empty
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it '絵地のためのコントローラである' do
+ expect(@model.item_name).to eq 'ground_picture'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_author', 'by_panel', 'show',
+ 'count', 'count_by_author', 'count_by_panel',
+ 'new', 'edit']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # 絵地の公開リストを返すように定義している
+ set_list_action? @action, 'ground_picture', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # 絵地の作家フィルタリストを返すように定義している
+ set_list_action? @action, 'ground_picture', '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, 'ground_picture', 'by_panel'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #絵地の公開リストのカウントを返すように定義している
+ set_list_action? @action, 'ground_picture', '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, 'ground_picture', '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, 'ground_picture', '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 'ground_picture'
+ 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 'ground_picture'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'ground_picture'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'ground_pictures'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['panel']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'panelに於いて' do
+ before do
+ @mani = @belongs_to['panel']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.id_column).to eq 'panel_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Panel
+ 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
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'panel_id', 'picture_id', 'caption', 'repeat', 'x', 'y',
+ 'z', 't',
+ 'created_at', 'updated_at']
+ end
+ describe 'panel_idに於いて' do
+ before do
+ @attribute = @attributes['panel_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'picture_idに於いて' do
+ before do
+ @attribute = @attributes['picture_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @attribute = @attributes['caption']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'repeatに於いて' do
+ before do
+ @attribute = @attributes['repeat']
+ 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 'ground_picture_repeat_items'
+ end
+ end
+ describe 'xに於いて' do
+ before do
+ @attribute = @attributes['x']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'yに於いて' do
+ before do
+ @attribute = @attributes['y']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'zに於いて' do
+ before do
+ @attribute = @attributes['z']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#ライセンスグループ
+require 'spec_helper'
+
+describe LicenseGroup do
+ include ManifestsMacros
+ before do
+ @model = LicenseGroup
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#ライセンス
+require 'spec_helper'
+
+describe License do
+ include ManifestsMacros
+ before do
+ @model = License
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#原画ライセンスグループ
+require 'spec_helper'
+
+describe OriginalPictureLicenseGroup do
+ include ManifestsMacros
+ before do
+ @model = OriginalPictureLicenseGroup
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+#原画
+require 'spec_helper'
+
+describe OriginalPicture do
+ include ManifestsMacros
+ before do
+ @model = OriginalPicture
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#コマ絵
+describe PanelPicture do
+ include ManifestsMacros
+ before do
+ @model = PanelPicture
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'パネルの要素として利用されるエレメントである' do
+ expect(@model.ancestors.include?(Peta::Element)).to eq true
+ end
+ it '親モデルはパネルである' do
+ expect(@model.my_peta.parent_model_name).to eq 'panel'
+ end
+ describe 'ブーストに於いて' do
+ it '特筆すべき注意事項はない' do
+ expect(@model.my_peta.boost.keys).to be_empty
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'コマ絵のためのコントローラである' do
+ expect(@model.item_name).to eq 'panel_picture'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_author', 'by_panel', 'show',
+ 'count', 'count_by_author', 'count_by_panel',
+ 'new', 'edit']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コマ絵の公開リストを返すように定義している
+ set_list_action? @action, 'panel_picture', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コマ絵の作家フィルタリストを返すように定義している
+ set_list_action? @action, 'panel_picture', '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, 'panel_picture', 'by_panel'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #コマ絵の公開リストのカウントを返すように定義している
+ set_list_action? @action, 'panel_picture', '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, 'panel_picture', '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, 'panel_picture', '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 'panel_picture'
+ 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 'panel_picture'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'panel_picture'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'panel_pictures'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['panel']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'panelに於いて' do
+ before do
+ @mani = @belongs_to['panel']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.id_column).to eq 'panel_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Panel
+ 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
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'panel_id', 'picture_id', 'caption', 'x', 'y', 'width', 'height',
+ 'link', 'z', 't',
+ 'created_at', 'updated_at']
+ end
+ describe 'panel_idに於いて' do
+ before do
+ @attribute = @attributes['panel_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'picture_idに於いて' do
+ before do
+ @attribute = @attributes['picture_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @attribute = @attributes['caption']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'xに於いて' do
+ before do
+ @attribute = @attributes['x']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'yに於いて' do
+ before do
+ @attribute = @attributes['y']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'widthに於いて' do
+ before do
+ @attribute = @attributes['width']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'heightに於いて' do
+ before do
+ @attribute = @attributes['height']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'linkに於いて' do
+ before do
+ @attribute = @attributes['link']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'zに於いて' do
+ before do
+ @attribute = @attributes['z']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+require 'spec_helper'\r
+#コマ\r
+\r
+describe Panel do\r
+ include ManifestsMacros\r
+ before do\r
+ @model = Panel\r
+ end\r
+ \r
+ describe 'ペタナイズに於いて' do\r
+ it 'ルートである' do\r
+ expect(@model.ancestors.include?(Peta::Root)).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
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+ describe 'コントローラに於いて' do\r
+ before do\r
+ @controller = @model.my_controller\r
+ end\r
+ it 'コマのためのコントローラである' do\r
+ expect(@model.item_name).to eq 'panel'\r
+ end\r
+ describe 'actionに於いて' do\r
+ before do\r
+ @actions = @controller.actions\r
+ @actions_names = ['index', 'by_author', 'by_scroll', 'by_sheet', 'by_speech_balloon_template', 'show', \r
+ 'count', 'count_by_author', 'count_by_scroll', 'count_by_sheet', 'count_by_speech_balloon_template', \r
+ 'new', 'edit', 'create', 'update', 'destroy']\r
+ end\r
+ it 'これらのアクションが定義されている' do\r
+ set_actions? @actions, @actions_names\r
+ end\r
+ describe 'baseに於いて' do\r
+ end\r
+ describe 'indexに於いて' do\r
+ before do\r
+ @action = @actions['index']\r
+ end\r
+ it 'listタイプのアクションである' do\r
+ expect(@action.type).to eq 'list'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # コマの公開リストを返すように定義している\r
+ set_list_action? @action, 'panel', 'public'\r
+ end\r
+ end\r
+ describe 'by_authorに於いて' do\r
+ before do\r
+ @action = @actions['by_author']\r
+ end\r
+ it 'listタイプのアクションである' do\r
+ expect(@action.type).to eq 'list'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # コマの作家フィルタリストを返すように定義している\r
+ set_list_action? @action, 'panel', 'by_author'\r
+ end\r
+ end\r
+ describe 'by_scrollに於いて' do\r
+ before do\r
+ @action = @actions['by_scroll']\r
+ end\r
+ it 'listタイプのアクションである' do\r
+ expect(@action.type).to eq 'list'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ #コマのコマフィルタリストを返すように定義している\r
+ set_list_action? @action, 'panel', 'by_scroll'\r
+ end\r
+ end\r
+ describe 'by_sheetに於いて' do\r
+ before do\r
+ @action = @actions['by_sheet']\r
+ end\r
+ it 'listタイプのアクションである' do\r
+ expect(@action.type).to eq 'list'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ #コマのコマフィルタリストを返すように定義している\r
+ set_list_action? @action, 'panel', 'by_sheet'\r
+ end\r
+ end\r
+ describe 'by_speech_balloon_templateに於いて' do\r
+ before do\r
+ @action = @actions['by_speech_balloon_template']\r
+ end\r
+ it 'listタイプのアクションである' do\r
+ expect(@action.type).to eq 'list'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ #コマのコマフィルタリストを返すように定義している\r
+ set_list_action? @action, 'panel', 'by_speech_balloon_template'\r
+ end\r
+ end\r
+ describe 'showに於いて' do\r
+ before do\r
+ @action = @actions['show']\r
+ end\r
+ it 'showタイプのアクションである' do\r
+ expect(@action.type).to eq 'show'\r
+ end\r
+ end\r
+ describe 'countに於いて' do\r
+ before do\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, 'panel', 'public'\r
+ end\r
+ end\r
+ describe 'count_by_authorに於いて' do\r
+ before do\r
+ @action = @actions['count_by_author']\r
+ end\r
+ it 'countタイプのアクションである' do\r
+ expect(@action.type).to eq 'count'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # コマの作家フィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'panel', 'by_author'\r
+ end\r
+ end\r
+ describe 'count_by_scrollに於いて' do\r
+ before do\r
+ @action = @actions['count_by_scroll']\r
+ end\r
+ it 'countタイプのアクションである' do\r
+ expect(@action.type).to eq 'count'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # コマのコマフィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'panel', 'by_scroll'\r
+ end\r
+ end\r
+ describe 'count_by_sheetに於いて' do\r
+ before do\r
+ @action = @actions['count_by_sheet']\r
+ end\r
+ it 'countタイプのアクションである' do\r
+ expect(@action.type).to eq 'count'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # コマのコマフィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'panel', 'by_sheet'\r
+ end\r
+ end\r
+ describe 'count_by_speech_balloon_templateに於いて' do\r
+ before do\r
+ @action = @actions['count_by_speech_balloon_template']\r
+ end\r
+ it 'countタイプのアクションである' do\r
+ expect(@action.type).to eq 'count'\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # コマのコマフィルタリストのカウントを返すように定義している\r
+ set_list_action? @action, 'panel', 'by_speech_balloon_template'\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 'panel'\r
+ end\r
+ end\r
+ describe 'editに於いて' 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 'panel'\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 'panel'\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 'panel'\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 'panel'\r
+ end\r
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+ describe 'モデルに於いて' do\r
+ before do\r
+ @my_manifest = @model.my_manifest\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_manifest.model_name).to eq 'panel'\r
+ expect(@my_manifest.classify).to eq @model\r
+ expect(@my_manifest.table_name).to eq 'panels'\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
+ end\r
+ it 'これらのモデルに所属している' do\r
+ set_associations? @belongs_to, @names\r
+ end\r
+ describe 'authorに於いて' do\r
+ before do\r
+ @mani = @belongs_to['author']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'author'\r
+ expect(@mani.id_column).to eq 'author_id'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq Author\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', 'scrolls', 'sheet_panels', 'sheets', \r
+ 'panel_pictures', 'speech_balloons', 'ground_pictures', 'ground_colors']\r
+ end\r
+ it 'これらのモデルを所持している' do\r
+ set_associations? @has_many, @names\r
+ end\r
+ describe 'scroll_panelsに於いて' do\r
+ before do\r
+ @mani = @has_many['scroll_panels']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'scroll_panel'\r
+ expect(@mani.foreign_key).to eq 'panel_id'\r
+ expect(@mani.through).to be nil\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq ScrollPanel\r
+ end\r
+ end\r
+ describe 'scrollsに於いて' do\r
+ before do\r
+ @mani = @has_many['scrolls']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'scroll'\r
+ expect(@mani.foreign_key).to eq 'panel_id'\r
+ expect(@mani.through).to eq 'scroll_panels'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be true\r
+ expect(@mani.model).to eq Scroll\r
+ end\r
+ end\r
+ describe 'sheet_panelsに於いて' do\r
+ before do\r
+ @mani = @has_many['sheet_panels']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'sheet_panel'\r
+ expect(@mani.foreign_key).to eq 'panel_id'\r
+ expect(@mani.through).to be nil\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq SheetPanel\r
+ end\r
+ end\r
+ describe 'sheetsに於いて' do\r
+ before do\r
+ @mani = @has_many['sheets']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'sheet'\r
+ expect(@mani.foreign_key).to eq 'panel_id'\r
+ expect(@mani.through).to eq 'sheet_panels'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be true\r
+ expect(@mani.model).to eq Sheet\r
+ end\r
+ end\r
+ describe 'panel_picturesに於いて' do\r
+ before do\r
+ @mani = @has_many['panel_pictures']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'panel_picture'\r
+ expect(@mani.foreign_key).to eq 'panel_id'\r
+ expect(@mani.through).to be nil\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq PanelPicture\r
+ end\r
+ end\r
+ describe 'speech_balloonsに於いて' do\r
+ before do\r
+ @mani = @has_many['speech_balloons']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'speech_balloon'\r
+ expect(@mani.foreign_key).to eq 'panel_id'\r
+ expect(@mani.through).to be nil\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq SpeechBalloon\r
+ end\r
+ end\r
+ describe 'ground_picturesに於いて' do\r
+ before do\r
+ @mani = @has_many['ground_pictures']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'ground_picture'\r
+ expect(@mani.foreign_key).to eq 'panel_id'\r
+ expect(@mani.through).to be nil\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq GroundPicture\r
+ end\r
+ end\r
+ describe 'ground_colorsに於いて' do\r
+ before do\r
+ @mani = @has_many['ground_colors']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'ground_color'\r
+ expect(@mani.foreign_key).to eq 'panel_id'\r
+ expect(@mani.through).to be nil\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq GroundColor\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'attributesに於いて' do\r
+ before do\r
+ @attributes = @model.my_manifest.attributes\r
+ end\r
+ it 'これらのカラムを定義している' do\r
+ set_attributes? @attributes, \r
+ ['id', 'width', 'height', 'border', 'caption', 'publish', 'author_id', \r
+ 'created_at', 'updated_at']\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 'borderに於いて' do\r
+ before do\r
+ @attribute = @attributes['border']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ describe 'captionに於いて' do\r
+ before do\r
+ @attribute = @attributes['caption']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'publishに於いて' do\r
+ before do\r
+ @attribute = @attributes['publish']\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 'panel_publish_items'\r
+ end\r
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['author_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+end\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+#実素材
+require 'spec_helper'
+
+describe Picture do
+ include ManifestsMacros
+ before do
+ @model = Picture
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+#素材\r
+require 'spec_helper'\r
+\r
+describe ResourcePicture do\r
+ include ManifestsMacros\r
+ before do\r
+ @model = ResourcePicture\r
+ end\r
+ \r
+ describe 'ペタナイズに於いて' do\r
+ it 'スクコマを閉じるためのバインダーである' do\r
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+ describe 'コントローラに於いて' do\r
+ before do\r
+ @controller = @model.my_controller\r
+ end\r
+ it 'スクロールのためのコントローラである' do\r
+ expect(@model.item_name).to eq 'scroll'\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
+ end\r
+ it 'これらのアクションが定義されている' do\r
+ set_actions? @actions, @actions_names\r
+ end\r
+ describe 'baseに於いて' do\r
+ end\r
+ describe 'indexに於いて' do\r
+ before do\r
+ @action = @actions['index']\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', 'public'\r
+ end\r
+ end\r
+ describe 'by_authorに於いて' do\r
+ before do\r
+ @action = @actions['by_author']\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
+ 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
+ end\r
+ end\r
+ describe 'countに於いて' do\r
+ before do\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', 'public'\r
+ end\r
+ end\r
+ describe 'count_by_authorに於いて' do\r
+ before do\r
+ @action = @actions['count_by_author']\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_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
+ 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
+ end\r
+ end\r
+ describe 'editに於いて' 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
+ 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
+ end\r
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+ describe 'モデルに於いて' do\r
+ before do\r
+ @my_manifest = @model.my_manifest\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_manifest.model_name).to eq 'scroll'\r
+ expect(@my_manifest.classify).to eq @model\r
+ expect(@my_manifest.table_name).to eq 'scrolls'\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
+ end\r
+ it 'これらのモデルに所属している' do\r
+ set_associations? @belongs_to, @names\r
+ end\r
+ describe 'authorに於いて' do\r
+ before do\r
+ @mani = @belongs_to['author']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'author'\r
+ expect(@mani.id_column).to eq 'author_id'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq Author\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
+ before do\r
+ @mani = @has_many['scroll_panels']\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
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq ScrollPanel\r
+ end\r
+ end\r
+ describe 'panelsに於いて' do\r
+ before do\r
+ @mani = @has_many['panels']\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
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be true\r
+ expect(@mani.model).to eq Panel\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'attributesに於いて' do\r
+ before do\r
+ @attributes = @model.my_manifest.attributes\r
+ end\r
+ it 'これらのカラムを定義している' do\r
+ set_attributes? @attributes, \r
+ ['id', 'title', 'description', 'visible', 'author_id', \r
+ 'created_at', 'updated_at']\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @attribute = @attributes['title']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @attribute = @attributes['description']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @attribute = @attributes['visible']\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
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['author_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+end\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#スクコマ
+describe ScrollPanel do
+ include ManifestsMacros
+ before do
+ @model = ScrollPanel
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクロールにコマを差し込むためのリーフである' do
+ expect(@model.ancestors.include?(Peta::Leaf)).to eq true
+ end
+ it '親モデルはスクロールである' do
+ expect(@model.my_peta.parent_model_name).to eq 'scroll'
+ end
+ describe 'ブーストに於いて' do
+ it '特筆すべき注意事項はない' do
+ expect(@model.my_peta.boost.keys).to be_empty
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクコマのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll_panel'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_author', 'by_panel', 'by_scroll', 'show',
+ 'count', 'count_by_author', 'count_by_panel', 'count_by_scroll',
+ 'new', 'edit', 'create', 'update', 'destroy']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクコマの公開リストを返すように定義している
+ set_list_action? @action, 'scroll_panel', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクコマの作家フィルタリストを返すように定義している
+ set_list_action? @action, 'scroll_panel', '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_panel', 'by_panel'
+ end
+ end
+ describe 'by_scrollに於いて' do
+ before do
+ @action = @actions['by_scroll']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクコマの作家フィルタリストを返すように定義している
+ set_list_action? @action, 'scroll_panel', 'by_scroll'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #スクコマの公開リストのカウントを返すように定義している
+ set_list_action? @action, 'scroll_panel', '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_panel', '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_panel', 'by_panel'
+ end
+ end
+ describe 'count_by_scrollに於いて' do
+ before do
+ @action = @actions['count_by_scroll']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクコマのコマフィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'scroll_panel', 'by_scroll'
+ 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_panel'
+ 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_panel'
+ 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_panel'
+ 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_panel'
+ 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_panel'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll_panel'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scroll_panels'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['panel', 'scroll']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'panelに於いて' do
+ before do
+ @mani = @belongs_to['panel']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.id_column).to eq 'panel_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Panel
+ end
+ end
+ describe 'scrollに於いて' do
+ before do
+ @mani = @belongs_to['scroll']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'scroll'
+ expect(@mani.id_column).to eq 'scroll_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Scroll
+ 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
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'scroll_id', 'panel_id', 't',
+ 'created_at', 'updated_at']
+ end
+ describe 'scroll_idに於いて' do
+ before do
+ @attribute = @attributes['scroll_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'panel_idに於いて' do
+ before do
+ @attribute = @attributes['panel_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
set_list_action? @action, 'scroll', 'by_panel'
end
end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
describe 'countに於いて' do
before do
@action = @actions['count']
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#紙コマ
+describe SheetPanel do
+ include ManifestsMacros
+ before do
+ @model = SheetPanel
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#用紙
+
+describe Sheet do
+ include ManifestsMacros
+ before do
+ @model = Sheet
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#フキダシ
+
+describe SpeechBalloon do
+ include ManifestsMacros
+ before do
+ @model = SpeechBalloon
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'パネルの要素として利用されるエレメントである' do
+ expect(@model.ancestors.include?(Peta::Element)).to eq true
+ end
+ it '親モデルはパネルである' do
+ expect(@model.my_peta.parent_model_name).to eq 'panel'
+ end
+ describe 'ブーストに於いて' do
+ before do
+ @boosts = @model.my_peta.boost
+ @boosts_names = ['speech_balloon_template']
+ end
+ it 'これらのブーストが定義されている' do
+ set_boosts? @boosts, @boosts_names
+ end
+ describe 'フキダシテンプレートに於いて' do
+ before do
+ @mani = @boosts['speech_balloon_template']
+ end
+ it 'フキダシテンプレート' do
+ expect(@mani.level).to eq 'post'
+ expect(@mani.template_name).to eq 'speech_balloon_template'
+ expect(@mani.column_name_for_template_module).to eq 'speech_balloon_template_module_name'
+ expect(@mani.settings_column_name).to eq 'speech_balloon_template_settings'
+ expect(@mani.foreign_key).to eq 'speech_balloon_template_id'
+ end
+ it 'フキダシテンプレート' do
+ expect(@mani.item_name_for_extend_model).to eq 'speech_balloon'
+ expect(@mani.setter_method_name).to eq 'speech_balloon_extend='
+ expect(@mani.getter_method_name).to eq 'speech_balloon_extend'
+ expect(@mani.extend_model_class_name).to eq 'SpeechBalloon'
+ expect(@mani.extend_module_name).to eq 'SpeechBalloonModule'
+ end
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'コマ絵のためのコントローラである' do
+ expect(@model.item_name).to eq 'speech_balloon'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_author', 'by_panel', 'by_speech_balloon_template', 'show',
+ 'count', 'count_by_author', 'count_by_panel', 'count_by_speech_balloon_template',
+ 'new', 'edit']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コマ絵の公開リストを返すように定義している
+ set_list_action? @action, 'speech_balloon', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コマ絵の作家フィルタリストを返すように定義している
+ set_list_action? @action, 'speech_balloon', '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, 'speech_balloon', 'by_panel'
+ end
+ end
+ describe 'by_speech_balloon_templateに於いて' do
+ before do
+ @action = @actions['by_speech_balloon_template']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コマ絵のフキダシテンプレートフィルタリストを返すように定義している
+ set_list_action? @action, 'speech_balloon', 'by_speech_balloon_template'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #コマ絵の公開リストのカウントを返すように定義している
+ set_list_action? @action, 'speech_balloon', '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, 'speech_balloon', '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, 'speech_balloon', 'by_panel'
+ end
+ end
+ describe 'count_by_speech_balloon_templateに於いて' do
+ before do
+ @action = @actions['count_by_speech_balloon_template']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # コマ絵のフキダシテンプレートフィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'speech_balloon', 'by_speech_balloon_template'
+ 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 'speech_balloon'
+ 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 'speech_balloon'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'speech_balloon'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'speech_balloons'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['panel', 'speech_balloon_template']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'panelに於いて' do
+ before do
+ @mani = @belongs_to['panel']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'panel'
+ expect(@mani.id_column).to eq 'panel_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Panel
+ end
+ end
+ describe 'speech_balloon_templateに於いて' do
+ before do
+ @mani = @belongs_to['speech_balloon_template']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'speech_balloon_template'
+ expect(@mani.id_column).to eq 'speech_balloon_template_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq SpeechBalloonTemplate
+ end
+ end
+ end
+ describe 'has_oneに於いて' do
+ before do
+ @has_one = @model.my_manifest.associations.has_one
+ @names = ['balloon', 'speech']
+ end
+ it 'これらのモデルを所持している' do
+ set_associations? @has_one, @names
+ end
+ describe 'balloonに於いて' do
+ before do
+ @mani = @has_one['balloon']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'balloon'
+ expect(@mani.foreign_key).to eq 'speech_balloon_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Balloon
+ end
+ end
+ describe 'speechに於いて' do
+ before do
+ @mani = @has_one['speech']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'speech'
+ expect(@mani.foreign_key).to eq 'speech_balloon_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Speech
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'panel_id', 'speech_balloon_template_id', 'speech_balloon_template_module_name',
+ 'caption', 'speech_balloon_template_settings', 'z', 't',
+ 'created_at', 'updated_at']
+ end
+ describe 'panel_idに於いて' do
+ before do
+ @attribute = @attributes['panel_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'speech_balloon_template_idに於いて' do
+ before do
+ @attribute = @attributes['speech_balloon_template_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'speech_balloon_template_module_nameに於いて' do
+ before do
+ @attribute = @attributes['speech_balloon_template_module_name']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'captionに於いて' do
+ before do
+ @attribute = @attributes['caption']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'speech_balloon_template_settingsに於いて' do
+ before do
+ @attribute = @attributes['speech_balloon_template_settings']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'zに於いて' do
+ before do
+ @attribute = @attributes['z']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#フキダシテンプレート
+describe SpeechBalloonTemplate do
+ include ManifestsMacros
+ before do
+ @model = SpeechBalloonTemplate
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-\r
+#セリフ\r
+require 'spec_helper'\r
+\r
+describe Speech do\r
+ include ManifestsMacros\r
+ before do\r
+ @model = Speech\r
+ end\r
+ \r
+ describe 'ペタナイズに於いて' do\r
+ it 'スクコマを閉じるためのバインダーである' do\r
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+ describe 'コントローラに於いて' do\r
+ before do\r
+ @controller = @model.my_controller\r
+ end\r
+ it 'スクロールのためのコントローラである' do\r
+ expect(@model.item_name).to eq 'scroll'\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
+ end\r
+ it 'これらのアクションが定義されている' do\r
+ set_actions? @actions, @actions_names\r
+ end\r
+ describe 'baseに於いて' do\r
+ end\r
+ describe 'indexに於いて' do\r
+ before do\r
+ @action = @actions['index']\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', 'public'\r
+ end\r
+ end\r
+ describe 'by_authorに於いて' do\r
+ before do\r
+ @action = @actions['by_author']\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
+ 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
+ end\r
+ end\r
+ describe 'countに於いて' do\r
+ before do\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', 'public'\r
+ end\r
+ end\r
+ describe 'count_by_authorに於いて' do\r
+ before do\r
+ @action = @actions['count_by_author']\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_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
+ 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
+ end\r
+ end\r
+ describe 'editに於いて' 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
+ 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
+ end\r
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+ describe 'モデルに於いて' do\r
+ before do\r
+ @my_manifest = @model.my_manifest\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ expect(@my_manifest.model_name).to eq 'scroll'\r
+ expect(@my_manifest.classify).to eq @model\r
+ expect(@my_manifest.table_name).to eq 'scrolls'\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
+ end\r
+ it 'これらのモデルに所属している' do\r
+ set_associations? @belongs_to, @names\r
+ end\r
+ describe 'authorに於いて' do\r
+ before do\r
+ @mani = @belongs_to['author']\r
+ end\r
+ it 'マニフェストから設定を取り出している' do\r
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている\r
+ expect(@mani.model_name).to eq 'author'\r
+ expect(@mani.id_column).to eq 'author_id'\r
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている\r
+ expect(@mani.model).to eq Author\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
+ before do\r
+ @mani = @has_many['scroll_panels']\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
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be false\r
+ expect(@mani.model).to eq ScrollPanel\r
+ end\r
+ end\r
+ describe 'panelsに於いて' do\r
+ before do\r
+ @mani = @has_many['panels']\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
+ end\r
+ it 'サポート機能が動作している' do\r
+ # モデルを再現できている, 中間モデルフラグ\r
+ expect(@mani.through?).to be true\r
+ expect(@mani.model).to eq Panel\r
+ end\r
+ end\r
+ end\r
+ end\r
+ \r
+ describe 'attributesに於いて' do\r
+ before do\r
+ @attributes = @model.my_manifest.attributes\r
+ end\r
+ it 'これらのカラムを定義している' do\r
+ set_attributes? @attributes, \r
+ ['id', 'title', 'description', 'visible', 'author_id', \r
+ 'created_at', 'updated_at']\r
+ end\r
+ describe 'titleに於いて' do\r
+ before do\r
+ @attribute = @attributes['title']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'descriptionに於いて' do\r
+ before do\r
+ @attribute = @attributes['description']\r
+ end\r
+ it 'textタイプである' do\r
+ expect(@attribute.type).to eq 'text'\r
+ end\r
+ end\r
+ describe 'visibleに於いて' do\r
+ before do\r
+ @attribute = @attributes['visible']\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
+ end\r
+ describe 'author_idに於いて' do\r
+ before do\r
+ @attribute = @attributes['author_id']\r
+ end\r
+ it 'numberタイプである' do\r
+ expect(@attribute.type).to eq 'number'\r
+ end\r
+ end\r
+ end\r
+ \r
+ end\r
+ \r
+end\r
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#スト紙
+describe StorySheet do
+ include ManifestsMacros
+ before do
+ @model = StorySheet
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スト紙に用紙を差し込むためのリーフである' do
+ expect(@model.ancestors.include?(Peta::Leaf)).to eq true
+ end
+ it '親モデルはストーリーである' do
+ expect(@model.my_peta.parent_model_name).to eq 'story'
+ end
+ describe 'ブーストに於いて' do
+ it '特筆すべき注意事項はない' do
+ expect(@model.my_peta.boost.keys).to be_empty
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スト紙のためのコントローラである' do
+ expect(@model.item_name).to eq 'story_sheet'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_author', 'by_story', 'by_sheet', 'show',
+ 'count', 'count_by_author', 'count_by_story', 'count_by_sheet',
+ 'new', 'edit', 'create', 'update', 'destroy']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スト紙の公開リストを返すように定義している
+ set_list_action? @action, 'story_sheet', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スト紙の作家フィルタリストを返すように定義している
+ set_list_action? @action, 'story_sheet', 'by_author'
+ end
+ end
+ describe 'by_storyに於いて' do
+ before do
+ @action = @actions['by_story']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #スト紙のコマフィルタリストを返すように定義している
+ set_list_action? @action, 'story_sheet', 'by_story'
+ end
+ end
+ describe 'by_sheetに於いて' do
+ before do
+ @action = @actions['by_sheet']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #スト紙のコマフィルタリストを返すように定義している
+ set_list_action? @action, 'story_sheet', 'by_sheet'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #スト紙の公開リストのカウントを返すように定義している
+ set_list_action? @action, 'story_sheet', '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, 'story_sheet', 'by_author'
+ end
+ end
+ describe 'count_by_storyに於いて' do
+ before do
+ @action = @actions['count_by_story']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スト紙のコマフィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'story_sheet', 'by_story'
+ end
+ end
+ describe 'count_by_sheetに於いて' do
+ before do
+ @action = @actions['count_by_sheet']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スト紙のコマフィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'story_sheet', 'by_sheet'
+ 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 'story_sheet'
+ 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 'story_sheet'
+ 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 'story_sheet'
+ 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 'story_sheet'
+ 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 'story_sheet'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'story_sheet'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'story_sheets'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['story', 'sheet']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'storyに於いて' do
+ before do
+ @mani = @belongs_to['story']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'story'
+ expect(@mani.id_column).to eq 'story_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Story
+ end
+ end
+ describe 'sheetに於いて' do
+ before do
+ @mani = @belongs_to['sheet']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'sheet'
+ expect(@mani.id_column).to eq 'sheet_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Sheet
+ 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
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'story_id', 'sheet_id', 't',
+ 'created_at', 'updated_at']
+ end
+ describe 'story_idに於いて' do
+ before do
+ @attribute = @attributes['story_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'sheet_idに於いて' do
+ before do
+ @attribute = @attributes['sheet_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#ストーリー
+
+describe Story do
+ include ManifestsMacros
+ before do
+ @model = Story
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スト紙を閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'ストーリーのためのコントローラである' do
+ expect(@model.item_name).to eq 'story'
+ end
+ describe 'actionに於いて' do
+ before do
+ @actions = @controller.actions
+ @actions_names = ['index', 'by_author', 'by_comic', 'by_sheet', 'play', 'show',
+ 'count', 'count_by_author', 'count_by_comic', 'count_by_sheet',
+ 'new', 'edit', 'create', 'update', 'destroy']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # ストーリーの公開リストを返すように定義している
+ set_list_action? @action, 'story', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # ストーリーの作家フィルタリストを返すように定義している
+ set_list_action? @action, 'story', 'by_author'
+ end
+ end
+ describe 'by_comicに於いて' do
+ before do
+ @action = @actions['by_comic']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #ストーリーのコマフィルタリストを返すように定義している
+ set_list_action? @action, 'story', 'by_comic'
+ end
+ end
+ describe 'by_sheetに於いて' do
+ before do
+ @action = @actions['by_sheet']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #ストーリーのコマフィルタリストを返すように定義している
+ set_list_action? @action, 'story', 'by_sheet'
+ end
+ end
+ describe 'showに於いて' do
+ before do
+ @action = @actions['show']
+ end
+ it 'showタイプのアクションである' do
+ expect(@action.type).to eq 'show'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ #ストーリーの公開リストのカウントを返すように定義している
+ set_list_action? @action, 'story', '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, 'story', 'by_author'
+ end
+ end
+ describe 'count_by_comicに於いて' do
+ before do
+ @action = @actions['count_by_comic']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # ストーリーのコマフィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'story', 'by_comic'
+ end
+ end
+ describe 'count_by_sheetに於いて' do
+ before do
+ @action = @actions['count_by_sheet']
+ end
+ it 'countタイプのアクションである' do
+ expect(@action.type).to eq 'count'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # ストーリーのコマフィルタリストのカウントを返すように定義している
+ set_list_action? @action, 'story', 'by_sheet'
+ 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 'story'
+ 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 'story'
+ 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 'story'
+ 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 'story'
+ 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 'story'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'story'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'stories'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ end
+ end
+ end
+ describe 'has_manyに於いて' do
+ before do
+ @has_many = @model.my_manifest.associations.has_many
+ @names = ['comic_stories', 'comics', 'comic_stories', 'comics']
+ end
+ it 'これらのモデルを所持している' do
+ set_associations? @has_many, @names
+ end
+ describe 'comic_storiesに於いて' do
+ before do
+ @mani = @has_many['comic_stories']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'comic_story'
+ expect(@mani.foreign_key).to eq 'story_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ComicStory
+ end
+ end
+ describe 'comicsに於いて' do
+ before do
+ @mani = @has_many['comics']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'comic'
+ expect(@mani.foreign_key).to eq 'story_id'
+ expect(@mani.through).to eq 'comic_stories'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Comic
+ end
+ end
+ describe 'story_sheetsに於いて' do
+ before do
+ @mani = @has_many['story_sheets']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'story_sheet'
+ expect(@mani.foreign_key).to eq 'story_id'
+ expect(@mani.through).to be nil
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq StorySheet
+ end
+ end
+ describe 'sheetsに於いて' do
+ before do
+ @mani = @has_many['sheets']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名, 外部キーと中間モデルが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'sheet'
+ expect(@mani.foreign_key).to eq 'story_id'
+ expect(@mani.through).to eq 'story_sheets'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Sheet
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 't', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'tに於いて' do
+ before do
+ @attribute = @attributes['t']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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 'story_visible_items'
+ end
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#システム画像
+describe SystemPicture do
+ include ManifestsMacros
+ before do
+ @model = SystemPicture
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
--- /dev/null
+# -*- encoding: utf-8 -*-
+require 'spec_helper'
+#シ
+
+describe WritingFormat do
+ include ManifestsMacros
+ before do
+ @model = WritingFormat
+ end
+
+ describe 'ペタナイズに於いて' do
+ it 'スクコマを閉じるためのバインダーである' do
+ expect(@model.ancestors.include?(Peta::Binder)).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
+ end
+ end
+
+ end
+
+ describe 'コントローラに於いて' do
+ before do
+ @controller = @model.my_controller
+ end
+ it 'スクロールのためのコントローラである' do
+ expect(@model.item_name).to eq 'scroll'
+ 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']
+ end
+ it 'これらのアクションが定義されている' do
+ set_actions? @actions, @actions_names
+ end
+ describe 'baseに於いて' do
+ end
+ describe 'indexに於いて' do
+ before do
+ @action = @actions['index']
+ end
+ it 'listタイプのアクションである' do
+ expect(@action.type).to eq 'list'
+ end
+ it 'マニフェストから設定を取り出している' do
+ # スクロールの公開リストを返すように定義している
+ set_list_action? @action, 'scroll', 'public'
+ end
+ end
+ describe 'by_authorに於いて' do
+ before do
+ @action = @actions['by_author']
+ 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'
+ end
+ end
+ describe 'countに於いて' do
+ before do
+ @action = @actions['count']
+ end
+ it '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'
+ 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'
+ end
+ end
+ end
+
+ end
+
+ describe 'モデルに於いて' do
+ before do
+ @my_manifest = @model.my_manifest
+ end
+ it 'サポート機能が動作している' do
+ expect(@my_manifest.model_name).to eq 'scroll'
+ expect(@my_manifest.classify).to eq @model
+ expect(@my_manifest.table_name).to eq 'scrolls'
+ end
+
+ describe 'associationsに於いて' do
+ describe 'belongs_toに於いて' do
+ before do
+ @belongs_to = @my_manifest.associations.belongs_to
+ @names = ['author']
+ end
+ it 'これらのモデルに所属している' do
+ set_associations? @belongs_to, @names
+ end
+ describe 'authorに於いて' do
+ before do
+ @mani = @belongs_to['author']
+ end
+ it 'マニフェストから設定を取り出している' do
+ # モデル名と外部キーが定義あるいはデフォルト値補充されている
+ expect(@mani.model_name).to eq 'author'
+ expect(@mani.id_column).to eq 'author_id'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている
+ expect(@mani.model).to eq Author
+ 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
+ before do
+ @mani = @has_many['scroll_panels']
+ 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
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be false
+ expect(@mani.model).to eq ScrollPanel
+ end
+ end
+ describe 'panelsに於いて' do
+ before do
+ @mani = @has_many['panels']
+ 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'
+ end
+ it 'サポート機能が動作している' do
+ # モデルを再現できている, 中間モデルフラグ
+ expect(@mani.through?).to be true
+ expect(@mani.model).to eq Panel
+ end
+ end
+ end
+ end
+
+ describe 'attributesに於いて' do
+ before do
+ @attributes = @model.my_manifest.attributes
+ end
+ it 'これらのカラムを定義している' do
+ set_attributes? @attributes,
+ ['id', 'title', 'description', 'visible', 'author_id',
+ 'created_at', 'updated_at']
+ end
+ describe 'titleに於いて' do
+ before do
+ @attribute = @attributes['title']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'descriptionに於いて' do
+ before do
+ @attribute = @attributes['description']
+ end
+ it 'textタイプである' do
+ expect(@attribute.type).to eq 'text'
+ end
+ end
+ describe 'visibleに於いて' do
+ before do
+ @attribute = @attributes['visible']
+ 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
+ end
+ describe 'author_idに於いて' do
+ before do
+ @attribute = @attributes['author_id']
+ end
+ it 'numberタイプである' do
+ expect(@attribute.type).to eq 'number'
+ end
+ end
+ end
+
+ end
+
+end
#スクロール
describe Scroll do
-
before do
@admin =FactoryGirl.create :admin
@user_yas = FactoryGirl.create :user_yas_with_owner
-# This file is copied to spec/ when you run 'rails generate rspec:install'
-ENV["RAILS_ENV"] ||= 'test'
-require File.expand_path("../../config/environment", __FILE__)
-require 'rspec/rails'
-require File.dirname(__FILE__) + '/support/controller_macros'
-
-# Requires supporting ruby files with custom matchers and macros, etc,
-# in spec/support/ and its subdirectories.
-Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
-Dir.glob(File.dirname(__FILE__) + '/factories/*.rb').each {|f| require f }
-
-RSpec.configure do |config|
- config.deprecation_stream = File.open(File.dirname(__FILE__) + '/deprecations.txt', 'w')
- # == Mock Framework
- #
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
- #
- # config.mock_with :mocha
- # config.mock_with :flexmock
- # config.mock_with :rr
- config.mock_with :rspec
-
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
- config.fixture_path = "#{::Rails.root}/spec/fixtures"
-
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
- # examples within a transaction, remove the following line or assign false
- # instead of true.
- config.use_transactional_fixtures = true
-
- # If true, the base class of anonymous controllers will be inferred
- # automatically. This will be the default behavior in future versions of
- # rspec-rails.
- config.infer_base_class_for_anonymous_controllers = false
- config.include Devise::TestHelpers, :type => :controller
-# config.extend ControllerMacros, :type => :controller
- config.infer_spec_type_from_file_location!
- config.raise_errors_for_deprecations!
-
- config.include ControllerMacros
+require 'rubygems'
+require 'spork'
+#uncomment the following line to use spork with the debugger
+#require 'spork/ext/ruby-debug'
+
+Spork.prefork do
+ # Loading more in this block will cause your tests to run faster. However,
+ # if you change any configuration or code from libraries loaded here, you'll
+ # need to restart spork for it take effect.
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
+ ENV["RAILS_ENV"] ||= 'test'
+ require File.expand_path("../../config/environment", __FILE__)
+ require 'rspec/rails'
+ require File.dirname(__FILE__) + '/support/controller_macros'
+
+ # Requires supporting ruby files with custom matchers and macros, etc,
+ # in spec/support/ and its subdirectories.
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+ Dir.glob(File.dirname(__FILE__) + '/factories/*.rb').each {|f| require f }
+
+ RSpec.configure do |config|
+ config.deprecation_stream = File.open(File.dirname(__FILE__) + '/deprecations.txt', 'w')
+ # == Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+ config.mock_with :rspec
+
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
+
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, remove the following line or assign false
+ # instead of true.
+ config.use_transactional_fixtures = true
+
+ # If true, the base class of anonymous controllers will be inferred
+ # automatically. This will be the default behavior in future versions of
+ # rspec-rails.
+ config.infer_base_class_for_anonymous_controllers = false
+ config.include Devise::TestHelpers, :type => :controller
+ # config.extend ControllerMacros, :type => :controller
+ config.infer_spec_type_from_file_location!
+ config.raise_errors_for_deprecations!
+
+ config.include ControllerMacros
+ end
+
end
+
+Spork.each_run do
+ # This code will be run each time you run your specs.
+
+end
+
+# --- Instructions ---
+# Sort the contents of this file into a Spork.prefork and a Spork.each_run
+# block.
+#
+# The Spork.prefork block is run only once when the spork server is started.
+# You typically want to place most of your (slow) initializer code in here, in
+# particular, require'ing any 3rd-party gems that you don't normally modify
+# during development.
+#
+# The Spork.each_run block is run each time you run your specs. In case you
+# need to load files that tend to change during development, require them here.
+# With Rails, your application modules are loaded automatically, so sometimes
+# this block can remain empty.
+#
+# Note: You can modify files loaded *from* the Spork.each_run block without
+# restarting the spork server. However, this file itself will not be reloaded,
+# so if you change any of the code inside the each_run block, you still need to
+# restart the server. In general, if you have non-trivial code in this file,
+# it's advisable to move it into a separate file so you can easily edit it
+# without restarting spork. (For example, with RSpec, you could move
+# non-trivial code into a file spec/support/my_helper.rb, making sure that the
+# spec/support/* files are require'd from inside the each_run block.)
+#
+# Any code that is left outside the two blocks will be run during preforking
+# *and* during each_run -- that's probably not what you want.
+#
+# These instructions should self-destruct in 10 seconds. If they don't, feel
+# free to delete them.
+
+
+
+
module ManifestsMacros\r
+ def set_boosts? boosts, names\r
+ names.each do |name|\r
+ expect(boosts.keys).to include name\r
+ end\r
+ expect(boosts.keys.size).to eq names.size\r
+ end\r
+ \r
# コントローラのアクションのマニフェストが期待通りに記述されているか。数量と名称でチェックする。\r
def set_actions? actions, names\r
- expect(actions.keys.size).to eq names.size\r
names.each do |name|\r
expect(actions.keys).to include name\r
end\r
+ expect(actions.keys.size).to eq names.size\r
end\r
\r
def set_list_action? action, item_name, list_name\r
\r
# モデルのassociationのマニフェストが期待通りに記述されているか。数量と名称でチェックする。\r
def set_associations? association, names\r
- expect(association.keys.size).to eq names.size\r
names.each do |name|\r
expect(association.keys).to include name\r
end\r
+ expect(association.keys.size).to eq names.size\r
end\r
\r
# モデルのカラムのマニフェストが期待通りに記述されているか。数量と名称でチェックする。\r
def set_attributes? attributes, names\r
- expect(attributes.keys.size).to eq names.size\r
names.each do |name|\r
expect(attributes.keys).to include name\r
end\r
+ expect(attributes.keys.size).to eq names.size\r
end\r
\r
end\r