Skip to content

Commit 2d0c22d

Browse files
committed
add(annotate_models_spec): test coverage
1 parent 2d7694e commit 2d0c22d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

spec/annotate/annotate_models_spec.rb

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,19 @@ def mock_column(name, type, options={})
184184
],
185185
[
186186
mock_foreign_key(
187-
'fk_rails_02e851e3b7',
187+
'fk_rails_cf2568e89e',
188188
'foreign_thing_id',
189189
'foreign_things'
190+
),
191+
mock_foreign_key(
192+
'custom_fk_name',
193+
'other_thing_id',
194+
'other_things'
195+
),
196+
mock_foreign_key(
197+
'fk_rails_a70234b26c',
198+
'third_thing_id',
199+
'third_things'
190200
)
191201
])
192202
expect(AnnotateModels.get_schema_info(klass, "Schema Info", :show_foreign_keys => true)).to eql(<<-EOS)
@@ -199,7 +209,9 @@ def mock_column(name, type, options={})
199209
#
200210
# Foreign Keys
201211
#
202-
# fk_rails_02e851e3b7 (foreign_thing_id => foreign_things.id)
212+
# custom_fk_name (other_thing_id => other_things.id)
213+
# fk_rails_a70234b26c (third_thing_id => third_things.id)
214+
# fk_rails_cf2568e89e (foreign_thing_id => foreign_things.id)
203215
#
204216
EOS
205217
end

0 commit comments

Comments
 (0)