Skip to content

Commit bdaa07b

Browse files
committed
Move test cases 'when "classified_sort" is specified in options'
1 parent c781605 commit bdaa07b

File tree

1 file changed

+33
-33
lines changed

1 file changed

+33
-33
lines changed

spec/lib/annotate/annotate_models_spec.rb

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,6 +1018,39 @@ def mock_column(name, type, options = {})
10181018
end
10191019
end
10201020
end
1021+
1022+
context 'when "classified_sort" is specified in options' do
1023+
let :columns do
1024+
[
1025+
mock_column(:active, :boolean, limit: 1),
1026+
mock_column(:name, :string, limit: 50),
1027+
mock_column(:notes, :text, limit: 55)
1028+
]
1029+
end
1030+
1031+
context 'when "classified_sort" is "yes"' do
1032+
let :options do
1033+
{ classified_sort: 'yes' }
1034+
end
1035+
1036+
let :expected_result do
1037+
<<~EOS
1038+
# Schema Info
1039+
#
1040+
# Table name: users
1041+
#
1042+
# active :boolean not null
1043+
# name :string(50) not null
1044+
# notes :text(55) not null
1045+
#
1046+
EOS
1047+
end
1048+
1049+
it 'works with option "classified_sort"' do
1050+
is_expected.to eq expected_result
1051+
end
1052+
end
1053+
end
10211054
end
10221055
end
10231056
end
@@ -1471,39 +1504,6 @@ def mock_column(name, type, options = {})
14711504
end
14721505

14731506
context 'with options' do
1474-
context 'when "classified_sort" is specified in options' do
1475-
let :columns do
1476-
[
1477-
mock_column(:active, :boolean, limit: 1),
1478-
mock_column(:name, :string, limit: 50),
1479-
mock_column(:notes, :text, limit: 55)
1480-
]
1481-
end
1482-
1483-
context 'when "classified_sort" is "yes"' do
1484-
let :options do
1485-
{ classified_sort: 'yes' }
1486-
end
1487-
1488-
let :expected_result do
1489-
<<~EOS
1490-
# Schema Info
1491-
#
1492-
# Table name: users
1493-
#
1494-
# active :boolean not null
1495-
# name :string(50) not null
1496-
# notes :text(55) not null
1497-
#
1498-
EOS
1499-
end
1500-
1501-
it 'works with option "classified_sort"' do
1502-
is_expected.to eq expected_result
1503-
end
1504-
end
1505-
end
1506-
15071507
context 'when "with_comment" is specified in options' do
15081508
context 'when "with_comment" is "yes"' do
15091509
let :options do

0 commit comments

Comments
 (0)