Skip to content

Commit bff7b46

Browse files
committed
Change position of test cases
1 parent 4448ac2 commit bff7b46

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

spec/lib/annotate/annotate_models_spec.rb

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -196,29 +196,6 @@ def mock_column(name, type, options = {})
196196
expect(AnnotateModels.get_schema_info(klass, 'Schema Info')).to eql(expected_result)
197197
end
198198

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-
222199
it 'should get schema info with enum type' do
223200
klass = mock_class(:users,
224201
nil,
@@ -935,6 +912,29 @@ def mock_column(name, type, options = {})
935912
expect(AnnotateModels.get_schema_info(klass, AnnotateModels::PREFIX, format_markdown: true, show_indexes: true)).to eql(expected_result)
936913
end
937914

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+
938938
it 'should work with the Globalize gem' do
939939
klass = mock_class(:posts,
940940
:id,

0 commit comments

Comments
 (0)