@@ -196,29 +196,6 @@ def mock_column(name, type, options = {})
196
196
expect ( AnnotateModels . get_schema_info ( klass , 'Schema Info' ) ) . to eql ( expected_result )
197
197
end
198
198
199
- it 'should get schema info even if the primary key is array, if using composite_primary_keys' do
200
- klass = mock_class ( :users ,
201
- [ :a_id , :b_id ] ,
202
- [
203
- mock_column ( :a_id , :integer ) ,
204
- mock_column ( :b_id , :integer ) ,
205
- mock_column ( :name , :string , limit : 50 )
206
- ] )
207
-
208
- expected_result = <<~EOS
209
- # Schema Info
210
- #
211
- # Table name: users
212
- #
213
- # a_id :integer not null, primary key
214
- # b_id :integer not null, primary key
215
- # name :string(50) not null
216
- #
217
- EOS
218
-
219
- expect ( AnnotateModels . get_schema_info ( klass , 'Schema Info' ) ) . to eql ( expected_result )
220
- end
221
-
222
199
it 'should get schema info with enum type' do
223
200
klass = mock_class ( :users ,
224
201
nil ,
@@ -935,6 +912,29 @@ def mock_column(name, type, options = {})
935
912
expect ( AnnotateModels . get_schema_info ( klass , AnnotateModels ::PREFIX , format_markdown : true , show_indexes : true ) ) . to eql ( expected_result )
936
913
end
937
914
915
+ it 'should get schema info even if the primary key is array, if using composite_primary_keys' do
916
+ klass = mock_class ( :users ,
917
+ [ :a_id , :b_id ] ,
918
+ [
919
+ mock_column ( :a_id , :integer ) ,
920
+ mock_column ( :b_id , :integer ) ,
921
+ mock_column ( :name , :string , limit : 50 )
922
+ ] )
923
+
924
+ expected_result = <<~EOS
925
+ # Schema Info
926
+ #
927
+ # Table name: users
928
+ #
929
+ # a_id :integer not null, primary key
930
+ # b_id :integer not null, primary key
931
+ # name :string(50) not null
932
+ #
933
+ EOS
934
+
935
+ expect ( AnnotateModels . get_schema_info ( klass , 'Schema Info' ) ) . to eql ( expected_result )
936
+ end
937
+
938
938
it 'should work with the Globalize gem' do
939
939
klass = mock_class ( :posts ,
940
940
:id ,
0 commit comments