Skip to content

Commit 4448ac2

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

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
@@ -175,29 +175,6 @@ def mock_column(name, type, options = {})
175175
end
176176
end
177177

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-
201178
it 'should get schema info even if the primary key is not set' do
202179
klass = mock_class(:users,
203180
nil,
@@ -292,6 +269,29 @@ def mock_column(name, type, options = {})
292269
expect(AnnotateModels.get_schema_info(klass, 'Schema Info')).to eql(expected_result)
293270
end
294271

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+
295295
it 'should get schema info for integer and boolean with default' do
296296
klass = mock_class(:users,
297297
:id,

0 commit comments

Comments
 (0)