1 # -*- encoding: utf-8 -*-
6 include LocalManifestsMacros
11 describe 'ファイラーに於いて' do
13 @my_local_manifest = LocalManifest.manifest.filers[@model.item_name]
16 expect(@my_local_manifest.item_class).to eq @model
17 expect(@my_local_manifest.item_name).to eq @model.item_name
18 expect(@my_local_manifest.filer_name).to eq @model.item_name
20 describe 'symbolに於いて' do
22 @symbol = @my_local_manifest.symbol
24 it 'defaultタイプのsymbolである' do
25 expect(@symbol.type).to eq 'default'
28 expect(@symbol.visible?).to be true
30 describe 'faceに於いて' do
34 it 'imageタイプのfaceである' do
35 expect(@face.type).to eq 'image'
37 it 'マニフェストから設定を取り出している' do
38 expect(@face.url).to eq '/images/folder.gif'
41 describe 'linkに於いて' do
45 it 'actionタイプのlinkである' do
46 expect(@link.type).to eq 'action'
48 it 'マニフェストから設定を取り出している' do
49 expect(@link.action_name).to eq 'show'
52 expect(@link.action_path).to eq '/folders/'
56 describe 'captionに於いて' do
58 @caption = @my_local_manifest.caption
60 it 'defaultタイプのsymbolである' do
61 expect(@caption.type).to eq 'default'
64 expect(@caption.visible?).to be true
66 describe 'faceに於いて' do
70 it 'columnタイプのfaceである' do
71 expect(@face.type).to eq 'method'
73 it 'マニフェストから設定を取り出している' do
74 expect(@face.method_name).to eq 'caption'
77 describe 'linkに於いて' do
81 it 'actionタイプのlinkである' do
82 expect(@link.type).to eq 'action'
84 it 'マニフェストから設定を取り出している' do
85 expect(@link.action_name).to eq 'show'
88 expect(@link.action_path).to eq '/folders/'
92 describe 'summaryに於いて' do
94 @summary = @my_local_manifest.summary
96 it 'templateタイプのsymbolである' do
97 expect(@summary.type).to eq 'template'
99 it 'マニフェストから設定を取り出している' do
100 expect(@summary.template_name).to eq 'summary'
103 describe 'iconに於いて' do
105 @icon = @my_local_manifest.icon
107 it 'defaultタイプのsymbolである' do
108 expect(@icon.type).to eq 'default'
110 it 'サポート機能が動作している' do
111 expect(@icon.visible?).to be true
114 describe 'dateに於いて' do
116 @date = @my_local_manifest.date
118 it 'defaultタイプのsymbolである' do
119 expect(@date.type).to eq 'default'
121 it 'サポート機能が動作している' do
122 expect(@date.visible?).to be true
125 describe 'editに於いて' do
127 @edit = @my_local_manifest.edit
129 it 'defaultタイプのsymbolである' do
130 expect(@edit.type).to eq 'default'
132 it 'サポート機能が動作している' do
133 expect(@edit.visible?).to be true
138 describe 'プロファイラーに於いて' do
140 @my_local_manifest = LocalManifest.manifest.profilers[@model.item_name]
142 it 'マニフェストから設定を取り出している' do
143 expect(@my_local_manifest.item_name).to eq @model.item_name
145 describe 'columnsに於いて' do
147 @columns = @my_local_manifest.columns
148 @names = ['id', 'name', 'controller_name', 'action_name', 'category_id',
149 't', 'parent_id', 'lft', 'rgt', 'depth', 'created_at', 'updated_at']
151 it 'これらのカラムが定義されている' do
152 set_columns? @columns, @names
154 describe 'nameに於いて' do
156 @column = @columns['name']
158 it 'defaultタイプのcolumnである' do
159 expect(@column.type).to eq 'default'
161 it 'マニフェストから設定を取り出している' do
162 expect(@column.item_name).to eq 'folder'
165 describe 'controller_nameに於いて' do
167 @column = @columns['controller_name']
169 it 'defaultタイプのcolumnである' do
170 expect(@column.type).to eq 'default'
172 it 'マニフェストから設定を取り出している' do
173 expect(@column.item_name).to eq 'folder'
176 describe 'action_nameに於いて' do
178 @column = @columns['action_name']
180 it 'マニフェストから設定を取り出している' do
181 expect(@column.item_name).to eq 'folder'
184 describe 'category_idに於いて' do
186 @column = @columns['category_id']
188 it 'defaultタイプのcolumnである' do
189 expect(@column.type).to eq 'default'
191 it 'マニフェストから設定を取り出している' do
192 expect(@column.item_name).to eq 'folder'
197 @column = @columns['t']
199 it 'defaultタイプのcolumnである' do
200 expect(@column.type).to eq 'default'
202 it 'マニフェストから設定を取り出している' do
203 expect(@column.item_name).to eq 'folder'
206 describe 'parent_idに於いて' do
208 @column = @columns['parent_id']
210 it 'defaultタイプのcolumnである' do
211 expect(@column.type).to eq 'default'
213 it 'マニフェストから設定を取り出している' do
214 expect(@column.item_name).to eq 'folder'
217 describe 'lftに於いて' do
219 @column = @columns['lft']
221 it 'defaultタイプのcolumnである' do
222 expect(@column.type).to eq 'default'
224 it 'マニフェストから設定を取り出している' do
225 expect(@column.item_name).to eq 'folder'
228 describe 'rgtに於いて' do
230 @column = @columns['rgt']
232 it 'defaultタイプのcolumnである' do
233 expect(@column.type).to eq 'default'
235 it 'マニフェストから設定を取り出している' do
236 expect(@column.item_name).to eq 'folder'
239 describe 'depthに於いて' do
241 @column = @columns['depth']
243 it 'defaultタイプのcolumnである' do
244 expect(@column.type).to eq 'default'
246 it 'マニフェストから設定を取り出している' do
247 expect(@column.item_name).to eq 'folder'
251 describe 'column_namesに於いて' do
253 @column_names = @my_local_manifest.column_names
256 expect(@column_names.size).to eq 9 + 3
259 expect(@column_names).to eq ['id', 'name', 'controller_name', 'action_name', 'category_id',
260 't', 'parent_id', 'lft', 'rgt', 'depth', 'created_at', 'updated_at']
263 describe 'extend_settingsに於いて' do
265 @extend_settings = @my_local_manifest.extend_settings
268 expect(@extend_settings).to be_empty
271 describe 'listsに於いて' do
273 @lists = @my_local_manifest.lists
276 expect(@lists).to be_empty
279 describe 'associationsに於いて' do
281 @associations = @my_local_manifest.associations
283 describe 'belongs_toに於いて' do
285 @belongs_to = @associations.belongs_to
287 it 'これらの所属モデルを取り扱う' do
288 expect(@belongs_to.map {|a| a.name}).to eq []
291 describe 'has_manyに於いて' do
293 @has_many = @associations.has_many
295 it 'これらの所持モデルを取り扱う' do
296 expect(@has_many.map {|a| a.table_name}).to eq []
302 describe 'リストグループに於いて' do
304 @my_local_manifest = LocalManifest.manifest.list_groups[@model.item_name]
306 it 'マニフェストから設定を取り出している' do
307 expect(@my_local_manifest.item_name).to eq @model.item_name
309 describe 'listsに於いて' do
311 @lists = @my_local_manifest.lists
313 it 'これらのリストを定義している' do
314 set_lists? @lists, ['public']
316 describe 'publicに於いて' do
318 @mani = @lists['public']
320 it 'マニフェストから設定を取り出している' do
321 expect(@mani.type).to eq 'public'
323 it 'マニフェストから設定を取り出している' do
324 expect(@mani.model).to eq Folder
326 it 'サポート機能が動作している' do
327 expect(@mani.has_id?).to be nil
328 expect(@mani.pre_id?).to be true
329 expect(@mani.item_name).to eq @model.item_name
331 describe 'whereに於いて' do
336 expect(@where.type).to eq 'auto'
338 it 'サポート機能が動作している' do
339 expect(@where.item_name).to eq @model.item_name
340 expect(@where.list_name).to eq 'public'
341 expect(@where.model).to eq Folder
344 expect(@where.method_name).to eq 'list_where'
347 describe 'includesに於いて' do
349 @includes = @mani.includes
352 expect(@includes.type).to eq 'auto'
354 it 'サポート機能が動作している' do
355 expect(@includes.item_name).to eq @model.item_name
356 expect(@includes.list_name).to eq 'public'
357 expect(@includes.model).to eq Folder
360 expect(@includes.includes).to be_empty
363 describe 'orderに於いて' do
368 expect(@order.type).to eq 'auto'
370 it 'サポート機能が動作している' do
371 expect(@order.item_name).to eq @model.item_name
372 expect(@order.list_name).to eq 'public'
373 expect(@order.model).to eq Folder
376 expect(@order.order).to eq 'list_order'
383 describe '入力フォームに於いて' do
385 @my_local_manifest = LocalManifest.manifest.forms[@model.item_name]
387 it 'マニフェストから設定を取り出している' do
388 expect(@my_local_manifest.name).to eq @model.item_name
390 describe 'fieldsに於いて' do
392 @fields = @my_local_manifest.fields
394 # 細かいチェックは後でやるので、大雑把に数量だけチェックしておく。
396 expect(@fields.size).to eq 10
399 describe 'field_namesに於いて' do
401 @field_names = @my_local_manifest.field_names
404 expect(@field_names.size).to eq 10
407 expect(@field_names).to eq ['name', 'controller_name', 'action_name', 'category_id',
408 't', 'parent_id', 'lft', 'rgt', 'depth', 'id']
412 # 本来fieldsでテストするべき内容だが、並び替えもテストしたいのでこちらで行う。
413 describe 'ordered_fieldsに於いて' do
415 @ordered_fields = @my_local_manifest.ordered_fields
416 @names = ['name', 'controller_name', 'action_name', 'category_id',
417 't', 'parent_id', 'lft', 'rgt', 'depth', 'id']
419 it 'これらのフィールドを取り扱う' do
420 expect(@ordered_fields.map {|f| f.name }).to eq @names
422 describe 'nameに於いて' do
424 @field = @ordered_fields[0]
426 it 'マニフェストから設定を取り出している' do
427 expect(@field.name).to eq 'name'
429 expect(@field.row_break).to be true
431 it 'サポート機能が動作している' do
432 expect(@field.part?).to be false
433 expect(@field.form_name).to eq @model.item_name
434 expect(@field.column_name).to eq 'name'
435 expect(@field.model_name).to eq @model.item_name
437 describe 'labelに於いて' do
439 @label = @field.label
441 it 'defaultタイプである' do
442 expect(@label.type).to eq 'default'
444 it 'マニフェストから設定を取り出している' do
446 expect(@label.row_break).to be false
448 it 'サポート機能が動作している' do
449 expect(@label.form_name).to eq @model.item_name
450 expect(@label.field_name).to eq 'name'
451 expect(@label.model_name).to eq @model.item_name
452 expect(@label.column_name).to eq 'name'
455 describe 'tagに於いて' do
460 # text/number/text_area/select/hidden default: text
461 expect(@tag.type).to eq 'text'
463 it 'マニフェストから設定を取り出している' do
464 expect(@tag.options).to_not be_empty
465 expect(@tag.options['size']).to eq 20
467 it 'サポート機能が動作している' do
468 expect(@tag.form_name).to eq @model.item_name
469 expect(@tag.field_name).to eq 'name'
473 describe 'controller_nameに於いて' do
475 @field = @ordered_fields[1]
477 it 'マニフェストから設定を取り出している' do
478 expect(@field.name).to eq 'controller_name'
480 expect(@field.row_break).to be true
482 it 'サポート機能が動作している' do
483 expect(@field.part?).to be false
484 expect(@field.form_name).to eq @model.item_name
485 expect(@field.column_name).to eq 'controller_name'
486 expect(@field.model_name).to eq @model.item_name
488 describe 'labelに於いて' do
490 @label = @field.label
492 it 'defaultタイプである' do
493 expect(@label.type).to eq 'default'
495 it 'マニフェストから設定を取り出している' do
497 expect(@label.row_break).to be false
499 it 'サポート機能が動作している' do
500 expect(@label.form_name).to eq @model.item_name
501 expect(@label.field_name).to eq 'controller_name'
502 expect(@label.model_name).to eq @model.item_name
503 expect(@label.column_name).to eq 'controller_name'
506 describe 'tagに於いて' do
511 # text/number/text_area/select/hidden default: text
512 expect(@tag.type).to eq 'text'
514 it 'マニフェストから設定を取り出している' do
515 expect(@tag.options).to_not be_empty
516 expect(@tag.options['size']).to eq 20
518 it 'サポート機能が動作している' do
519 expect(@tag.form_name).to eq @model.item_name
520 expect(@tag.field_name).to eq 'controller_name'
524 describe 'action_nameに於いて' do
526 @field = @ordered_fields[2]
528 it 'マニフェストから設定を取り出している' do
529 expect(@field.name).to eq 'action_name'
531 expect(@field.row_break).to be true
533 it 'サポート機能が動作している' do
534 expect(@field.part?).to be false
535 expect(@field.form_name).to eq @model.item_name
536 expect(@field.column_name).to eq 'action_name'
537 expect(@field.model_name).to eq @model.item_name
539 describe 'labelに於いて' do
541 @label = @field.label
543 it 'defaultタイプである' do
544 expect(@label.type).to eq 'default'
546 it 'マニフェストから設定を取り出している' do
548 expect(@label.row_break).to be false
550 it 'サポート機能が動作している' do
551 expect(@label.form_name).to eq @model.item_name
552 expect(@label.field_name).to eq 'action_name'
553 expect(@label.model_name).to eq @model.item_name
554 expect(@label.column_name).to eq 'action_name'
557 describe 'tagに於いて' do
562 # text/number/text_area/select/hidden default: text
563 expect(@tag.type).to eq 'text'
565 it 'マニフェストから設定を取り出している' do
566 expect(@tag.options).to_not be_empty
567 expect(@tag.options['size']).to eq 20
569 it 'サポート機能が動作している' do
570 expect(@tag.form_name).to eq @model.item_name
571 expect(@tag.field_name).to eq 'action_name'
575 describe 'category_idに於いて' do
577 @field = @ordered_fields[3]
579 it 'マニフェストから設定を取り出している' do
580 expect(@field.name).to eq 'category_id'
582 expect(@field.row_break).to be true
584 it 'サポート機能が動作している' do
585 expect(@field.part?).to be false
586 expect(@field.form_name).to eq @model.item_name
587 expect(@field.column_name).to eq 'category_id'
588 expect(@field.model_name).to eq @model.item_name
590 describe 'labelに於いて' do
592 @label = @field.label
594 it 'defaultタイプである' do
595 expect(@label.type).to eq 'default'
597 it 'マニフェストから設定を取り出している' do
599 expect(@label.row_break).to be false
601 it 'サポート機能が動作している' do
602 expect(@label.form_name).to eq @model.item_name
603 expect(@label.field_name).to eq 'category_id'
604 expect(@label.model_name).to eq @model.item_name
605 expect(@label.column_name).to eq 'category_id'
608 describe 'tagに於いて' do
613 # text/number/text_area/select/hidden default: text
614 expect(@tag.type).to eq 'number'
616 it 'マニフェストから設定を取り出している' do
617 expect(@tag.options).to_not be_empty
618 expect(@tag.options['size']).to eq 5
620 it 'サポート機能が動作している' do
621 expect(@tag.form_name).to eq @model.item_name
622 expect(@tag.field_name).to eq 'category_id'
628 @field = @ordered_fields[4]
630 it 'マニフェストから設定を取り出している' do
631 expect(@field.name).to eq 't'
633 expect(@field.row_break).to be true
635 it 'サポート機能が動作している' do
636 expect(@field.part?).to be false
637 expect(@field.form_name).to eq @model.item_name
638 expect(@field.column_name).to eq 't'
639 expect(@field.model_name).to eq @model.item_name
641 describe 'labelに於いて' do
643 @label = @field.label
645 it 'defaultタイプである' do
646 expect(@label.type).to eq 'default'
648 it 'マニフェストから設定を取り出している' do
650 expect(@label.row_break).to be false
652 it 'サポート機能が動作している' do
653 expect(@label.form_name).to eq @model.item_name
654 expect(@label.field_name).to eq 't'
655 expect(@label.model_name).to eq @model.item_name
656 expect(@label.column_name).to eq 't'
659 describe 'tagに於いて' do
664 # text/number/text_area/select/hidden default: text
665 expect(@tag.type).to eq 'number'
667 it 'マニフェストから設定を取り出している' do
668 expect(@tag.options).to_not be_empty
669 expect(@tag.options['size']).to eq 5
671 it 'サポート機能が動作している' do
672 expect(@tag.form_name).to eq @model.item_name
673 expect(@tag.field_name).to eq 't'
677 describe 'parent_idに於いて' do
679 @field = @ordered_fields[5]
681 it 'マニフェストから設定を取り出している' do
682 expect(@field.name).to eq 'parent_id'
684 expect(@field.row_break).to be true
686 it 'サポート機能が動作している' do
687 expect(@field.part?).to be false
688 expect(@field.form_name).to eq @model.item_name
689 expect(@field.column_name).to eq 'parent_id'
690 expect(@field.model_name).to eq @model.item_name
692 describe 'labelに於いて' do
694 @label = @field.label
696 it 'defaultタイプである' do
697 expect(@label.type).to eq 'default'
699 it 'マニフェストから設定を取り出している' do
701 expect(@label.row_break).to be false
703 it 'サポート機能が動作している' do
704 expect(@label.form_name).to eq @model.item_name
705 expect(@label.field_name).to eq 'parent_id'
706 expect(@label.model_name).to eq @model.item_name
707 expect(@label.column_name).to eq 'parent_id'
710 describe 'tagに於いて' do
715 # text/number/text_area/select/hidden default: text
716 expect(@tag.type).to eq 'number'
718 it 'マニフェストから設定を取り出している' do
719 expect(@tag.options).to_not be_empty
720 expect(@tag.options['size']).to eq 5
722 it 'サポート機能が動作している' do
723 expect(@tag.form_name).to eq @model.item_name
724 expect(@tag.field_name).to eq 'parent_id'
728 describe 'lftに於いて' do
730 @field = @ordered_fields[6]
732 it 'マニフェストから設定を取り出している' do
733 expect(@field.name).to eq 'lft'
735 expect(@field.row_break).to be true
737 it 'サポート機能が動作している' do
738 expect(@field.part?).to be false
739 expect(@field.form_name).to eq @model.item_name
740 expect(@field.column_name).to eq 'lft'
741 expect(@field.model_name).to eq @model.item_name
743 describe 'labelに於いて' do
745 @label = @field.label
747 it 'defaultタイプである' do
748 expect(@label.type).to eq 'default'
750 it 'マニフェストから設定を取り出している' do
752 expect(@label.row_break).to be false
754 it 'サポート機能が動作している' do
755 expect(@label.form_name).to eq @model.item_name
756 expect(@label.field_name).to eq 'lft'
757 expect(@label.model_name).to eq @model.item_name
758 expect(@label.column_name).to eq 'lft'
761 describe 'tagに於いて' do
766 # text/number/text_area/select/hidden default: text
767 expect(@tag.type).to eq 'number'
769 it 'マニフェストから設定を取り出している' do
770 expect(@tag.options).to_not be_empty
771 expect(@tag.options['size']).to eq 5
773 it 'サポート機能が動作している' do
774 expect(@tag.form_name).to eq @model.item_name
775 expect(@tag.field_name).to eq 'lft'
779 describe 'rgtに於いて' do
781 @field = @ordered_fields[7]
783 it 'マニフェストから設定を取り出している' do
784 expect(@field.name).to eq 'rgt'
786 expect(@field.row_break).to be true
788 it 'サポート機能が動作している' do
789 expect(@field.part?).to be false
790 expect(@field.form_name).to eq @model.item_name
791 expect(@field.column_name).to eq 'rgt'
792 expect(@field.model_name).to eq @model.item_name
794 describe 'labelに於いて' do
796 @label = @field.label
798 it 'defaultタイプである' do
799 expect(@label.type).to eq 'default'
801 it 'マニフェストから設定を取り出している' do
803 expect(@label.row_break).to be false
805 it 'サポート機能が動作している' do
806 expect(@label.form_name).to eq @model.item_name
807 expect(@label.field_name).to eq 'rgt'
808 expect(@label.model_name).to eq @model.item_name
809 expect(@label.column_name).to eq 'rgt'
812 describe 'tagに於いて' do
817 # text/number/text_area/select/hidden default: text
818 expect(@tag.type).to eq 'number'
820 it 'マニフェストから設定を取り出している' do
821 expect(@tag.options).to_not be_empty
822 expect(@tag.options['size']).to eq 5
824 it 'サポート機能が動作している' do
825 expect(@tag.form_name).to eq @model.item_name
826 expect(@tag.field_name).to eq 'rgt'
830 describe 'depthに於いて' do
832 @field = @ordered_fields[8]
834 it 'マニフェストから設定を取り出している' do
835 expect(@field.name).to eq 'depth'
837 expect(@field.row_break).to be true
839 it 'サポート機能が動作している' do
840 expect(@field.part?).to be false
841 expect(@field.form_name).to eq @model.item_name
842 expect(@field.column_name).to eq 'depth'
843 expect(@field.model_name).to eq @model.item_name
845 describe 'labelに於いて' do
847 @label = @field.label
849 it 'defaultタイプである' do
850 expect(@label.type).to eq 'default'
852 it 'マニフェストから設定を取り出している' do
854 expect(@label.row_break).to be false
856 it 'サポート機能が動作している' do
857 expect(@label.form_name).to eq @model.item_name
858 expect(@label.field_name).to eq 'depth'
859 expect(@label.model_name).to eq @model.item_name
860 expect(@label.column_name).to eq 'depth'
863 describe 'tagに於いて' do
868 # text/number/text_area/select/hidden default: text
869 expect(@tag.type).to eq 'number'
871 it 'マニフェストから設定を取り出している' do
872 expect(@tag.options).to_not be_empty
873 expect(@tag.options['size']).to eq 5
875 it 'サポート機能が動作している' do
876 expect(@tag.form_name).to eq @model.item_name
877 expect(@tag.field_name).to eq 'depth'
883 @field = @ordered_fields[9]
885 it 'マニフェストから設定を取り出している' do
886 expect(@field.name).to eq 'id'
887 expect(@field.row_break).to be true
889 it 'サポート機能が動作している' do
890 expect(@field.part?).to be false
891 expect(@field.form_name).to eq @model.item_name
892 expect(@field.column_name).to eq 'id'
893 expect(@field.model_name).to eq @model.item_name
899 describe 'bucketに於いて' do
901 @my_local_manifest = LocalManifest.manifest.buckets[@model.item_name]
903 it 'マニフェストから設定を取り出している' do
904 expect(@my_local_manifest.members).to be_empty
905 expect(@my_local_manifest.form_field_names).to be_empty
907 it 'サポート機能が動作している' do
908 expect(@my_local_manifest.has_member?).to be false
909 expect(@my_local_manifest.item_name).to eq @model.item_name