3 def valid_encode? item, text_column_names
\r
4 text_column_names.each do |name|
\r
5 expect(item.class.valid_encode_columns).to include name
\r
6 item.attributes[name] = "\x83G\x83r\x83]\x83D"
\r
7 # バージョンが上がって問題なくなったかもしれない
\r
8 #expect { item.valid_encode }.to raise_error(Pettanr::BadRequest)
\r
12 def define_child_models? model, models
\r
13 expect(model.child_models.size).to eq models.size
\r
15 expect(model.child_models).to include m
\r
19 def define_child_element_names? model, item_names
\r
20 expect(model.child_models.size).to eq item_names.size
\r
21 item_names.each do |m|
\r
22 expect(model.child_element_names).to include m
\r
26 def define_my_manifest? model
\r
27 expect(model.my_peta).to eq Manifest.manifest.items[model.item_name]
\r
28 expect(model.my_controller).to eq Manifest.manifest.controllers[model.table_name]
\r
29 expect(model.my_manifest).to eq Manifest.manifest.models[model.item_name]
\r
32 # マニフェストを取得するためのショートカット
\r
33 def define_my_manifest? model
\r
34 expect(model.my_peta).to eq Manifest.manifest.items[model.item_name]
\r
35 expect(model.my_controller).to eq Manifest.manifest.controllers[model.table_name]
\r
36 expect(model.my_manifest).to eq Manifest.manifest.models[model.item_name]
\r
39 # 名前の活用が正しく変化していることを確認している
\r
40 def set_name? item, subjects
\r
41 subjects.each do |name, value|
\r
42 expect(item.__send__(name)).to eq value
\r
47 def set_extend_column? model, subjects
\r
48 subjects.each do |name, value|
\r
49 expect(model.extend_column?(name)).to eq value
\r
53 # ブースターが用意されているか、名前だけでも確認する
\r
54 def set_boosters? item, names
\r
56 item.boosters.keys.each do |name|
\r
57 expect(name).to include names
\r
62 def fold_extend_settings? model, attr, extend_column_names
\r
63 model.fold_extend_settings attr
\r
64 extend_column_names.each do |name|
\r
65 expect(attr[name]).to be_kind_of String
\r
69 def define_test item
\r
70 expect {expect(item.dom_id)}.not_to raise_error
\r
71 expect {expect(item.editize?)}.not_to raise_error
\r
72 expect {expect(item.dom_pool_type)}.not_to raise_error
\r
73 expect {expect(item.merge_dom_item_id({}))}.not_to raise_error
\r
74 expect {expect(item.tag_attributes)}.not_to raise_error
\r
75 expect {expect(item.field_tag_attributes(:hoge))}.not_to raise_error
\r
76 expect {expect(item.post_attribute_key)}.not_to raise_error
\r
81 module ContentMacros
\r
83 def define_leaf_items? item, leaf_models
\r
84 expect(item.respond_to?(:leaf_items)).to be true
\r
85 leaf_models.each do |model|
\r
86 expect(item.leaf_items(model)).to_not be_empty
\r
87 expect(item.leaf_items(model).first.class).to eq model
\r
91 def define_leafs_items? item, leaf_models
\r
92 expect(item.respond_to?(:leafs_items)).to be true
\r
93 expect(item.leafs_items).to_not be_empty
\r
94 item.leafs_items.map {|i| i.class }.each do |model|
\r
95 expect(leaf_models).to include model
\r
101 module BinderMacros
\r
103 def define_leaf_items? item, leaf_models
\r
104 expect(item.respond_to?(:leaf_items)).to be true
\r
105 leaf_models.each do |model|
\r
106 expect(item.leaf_items(model)).to_not be_empty
\r
107 expect(item.leaf_items(model).first.class).to eq model
\r
111 def define_leafs_items? item, leaf_models
\r
112 expect(item.respond_to?(:leafs_items)).to be true
\r
113 expect(item.leafs_items).to_not be_empty
\r
114 item.leafs_items.map {|i| i.class }.each do |model|
\r
115 expect(leaf_models).to include model
\r
122 def define_test item
\r
123 expect {expect(item.new_t(0))}.not_to raise_error
\r
130 def define_leaf_items? item, leaf_models
\r
131 expect(item.respond_to?(:leaf_items)).to be true
\r
132 leaf_models.each do |model|
\r
133 expect(item.leaf_items(model)).to_not be_empty
\r
134 expect(item.leaf_items(model).first.class).to eq model
\r
138 def define_leafs_items? item, leaf_models
\r
139 expect(item.respond_to?(:leafs_items)).to be true
\r
140 expect(item.leafs_items).to_not be_empty
\r
141 item.leafs_items.map {|i| i.class }.each do |model|
\r
142 expect(leaf_models).to include model
\r
148 module ElementMacros
\r
150 def define_leaf_items? item, leaf_models
\r
151 expect(item.respond_to?(:leaf_items)).to be true
\r
152 leaf_models.each do |model|
\r
153 expect(item.leaf_items(model)).to_not be_empty
\r
154 expect(item.leaf_items(model).first.class).to eq model
\r
158 def define_leafs_items? item, leaf_models
\r
159 expect(item.respond_to?(:leafs_items)).to be true
\r
160 expect(item.leafs_items).to_not be_empty
\r
161 item.leafs_items.map {|i| i.class }.each do |model|
\r
162 expect(leaf_models).to include model
\r
170 def define_leaf_items? item, leaf_models
\r
171 expect(item.respond_to?(:leaf_items)).to be true
\r
172 leaf_models.each do |model|
\r
173 expect(item.leaf_items(model)).to_not be_empty
\r
174 expect(item.leaf_items(model).first.class).to eq model
\r
178 def define_leafs_items? item, leaf_models
\r
179 expect(item.respond_to?(:leafs_items)).to be true
\r
180 expect(item.leafs_items).to_not be_empty
\r
181 item.leafs_items.map {|i| i.class }.each do |model|
\r
182 expect(leaf_models).to include model
\r
188 module SystemResourceMacros
\r
190 def define_leaf_items? item, leaf_models
\r
191 expect(item.respond_to?(:leaf_items)).to be true
\r
192 leaf_models.each do |model|
\r
193 expect(item.leaf_items(model)).to_not be_empty
\r
194 expect(item.leaf_items(model).first.class).to eq model
\r
198 def define_leafs_items? item, leaf_models
\r
199 expect(item.respond_to?(:leafs_items)).to be true
\r
200 expect(item.leafs_items).to_not be_empty
\r
201 item.leafs_items.map {|i| i.class }.each do |model|
\r
202 expect(leaf_models).to include model
\r
208 module TemplateMacros
\r
210 def define_leaf_items? item, leaf_models
\r
211 expect(item.respond_to?(:leaf_items)).to be true
\r
212 leaf_models.each do |model|
\r
213 expect(item.leaf_items(model)).to_not be_empty
\r
214 expect(item.leaf_items(model).first.class).to eq model
\r
218 def define_leafs_items? item, leaf_models
\r
219 expect(item.respond_to?(:leafs_items)).to be true
\r
220 expect(item.leafs_items).to_not be_empty
\r
221 item.leafs_items.map {|i| i.class }.each do |model|
\r
222 expect(leaf_models).to include model
\r