@@ -175,29 +175,6 @@ def mock_column(name, type, options = {})
175
175
end
176
176
end
177
177
178
- it 'should get schema info with default options' do
179
- klass = mock_class ( :users ,
180
- :id ,
181
- [
182
- mock_column ( :id , :integer , limit : 8 ) ,
183
- mock_column ( :name , :string , limit : 50 ) ,
184
- mock_column ( :notes , :text , limit : 55 )
185
- ] )
186
-
187
- expected_result = <<~EOS
188
- # Schema Info
189
- #
190
- # Table name: users
191
- #
192
- # id :integer not null, primary key
193
- # name :string(50) not null
194
- # notes :text(55) not null
195
- #
196
- EOS
197
-
198
- expect ( AnnotateModels . get_schema_info ( klass , 'Schema Info' ) ) . to eql ( expected_result )
199
- end
200
-
201
178
it 'should get schema info even if the primary key is not set' do
202
179
klass = mock_class ( :users ,
203
180
nil ,
@@ -292,6 +269,29 @@ def mock_column(name, type, options = {})
292
269
expect ( AnnotateModels . get_schema_info ( klass , 'Schema Info' ) ) . to eql ( expected_result )
293
270
end
294
271
272
+ it 'should get schema info with default options' do
273
+ klass = mock_class ( :users ,
274
+ :id ,
275
+ [
276
+ mock_column ( :id , :integer , limit : 8 ) ,
277
+ mock_column ( :name , :string , limit : 50 ) ,
278
+ mock_column ( :notes , :text , limit : 55 )
279
+ ] )
280
+
281
+ expected_result = <<~EOS
282
+ # Schema Info
283
+ #
284
+ # Table name: users
285
+ #
286
+ # id :integer not null, primary key
287
+ # name :string(50) not null
288
+ # notes :text(55) not null
289
+ #
290
+ EOS
291
+
292
+ expect ( AnnotateModels . get_schema_info ( klass , 'Schema Info' ) ) . to eql ( expected_result )
293
+ end
294
+
295
295
it 'should get schema info for integer and boolean with default' do
296
296
klass = mock_class ( :users ,
297
297
:id ,
0 commit comments