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
123 def define_leaf_items? item, leaf_models
\r
124 expect(item.respond_to?(:leaf_items)).to be true
\r
125 leaf_models.each do |model|
\r
126 expect(item.leaf_items(model)).to_not be_empty
\r
127 expect(item.leaf_items(model).first.class).to eq model
\r
131 def define_leafs_items? item, leaf_models
\r
132 expect(item.respond_to?(:leafs_items)).to be true
\r
133 expect(item.leafs_items).to_not be_empty
\r
134 item.leafs_items.map {|i| i.class }.each do |model|
\r
135 expect(leaf_models).to include model
\r
143 def define_leaf_items? item, leaf_models
\r
144 expect(item.respond_to?(:leaf_items)).to be true
\r
145 leaf_models.each do |model|
\r
146 expect(item.leaf_items(model)).to_not be_empty
\r
147 expect(item.leaf_items(model).first.class).to eq model
\r
151 def define_leafs_items? item, leaf_models
\r
152 expect(item.respond_to?(:leafs_items)).to be true
\r
153 expect(item.leafs_items).to_not be_empty
\r
154 item.leafs_items.map {|i| i.class }.each do |model|
\r
155 expect(leaf_models).to include model
\r
161 module ElementMacros
\r
163 def define_leaf_items? item, leaf_models
\r
164 expect(item.respond_to?(:leaf_items)).to be true
\r
165 leaf_models.each do |model|
\r
166 expect(item.leaf_items(model)).to_not be_empty
\r
167 expect(item.leaf_items(model).first.class).to eq model
\r
171 def define_leafs_items? item, leaf_models
\r
172 expect(item.respond_to?(:leafs_items)).to be true
\r
173 expect(item.leafs_items).to_not be_empty
\r
174 item.leafs_items.map {|i| i.class }.each do |model|
\r
175 expect(leaf_models).to include model
\r
183 def define_leaf_items? item, leaf_models
\r
184 expect(item.respond_to?(:leaf_items)).to be true
\r
185 leaf_models.each do |model|
\r
186 expect(item.leaf_items(model)).to_not be_empty
\r
187 expect(item.leaf_items(model).first.class).to eq model
\r
191 def define_leafs_items? item, leaf_models
\r
192 expect(item.respond_to?(:leafs_items)).to be true
\r
193 expect(item.leafs_items).to_not be_empty
\r
194 item.leafs_items.map {|i| i.class }.each do |model|
\r
195 expect(leaf_models).to include model
\r
201 module SystemResourceMacros
\r
203 def define_leaf_items? item, leaf_models
\r
204 expect(item.respond_to?(:leaf_items)).to be true
\r
205 leaf_models.each do |model|
\r
206 expect(item.leaf_items(model)).to_not be_empty
\r
207 expect(item.leaf_items(model).first.class).to eq model
\r
211 def define_leafs_items? item, leaf_models
\r
212 expect(item.respond_to?(:leafs_items)).to be true
\r
213 expect(item.leafs_items).to_not be_empty
\r
214 item.leafs_items.map {|i| i.class }.each do |model|
\r
215 expect(leaf_models).to include model
\r
221 module TemplateMacros
\r
223 def define_leaf_items? item, leaf_models
\r
224 expect(item.respond_to?(:leaf_items)).to be true
\r
225 leaf_models.each do |model|
\r
226 expect(item.leaf_items(model)).to_not be_empty
\r
227 expect(item.leaf_items(model).first.class).to eq model
\r
231 def define_leafs_items? item, leaf_models
\r
232 expect(item.respond_to?(:leafs_items)).to be true
\r
233 expect(item.leafs_items).to_not be_empty
\r
234 item.leafs_items.map {|i| i.class }.each do |model|
\r
235 expect(leaf_models).to include model
\r