Commit 22d796c4 by Steve Klebanoff Committed by Cuong Tran

Fix show_complete_foreign_keys setting (#475)

* add show_complete_foreign_keys as setting * test for show_complete_foreign_keys setting
parent c24f64c3
...@@ -30,7 +30,8 @@ module Annotate ...@@ -30,7 +30,8 @@ module Annotate
:show_indexes, :simple_indexes, :include_version, :exclude_tests, :show_indexes, :simple_indexes, :include_version, :exclude_tests,
:exclude_fixtures, :exclude_factories, :ignore_model_sub_dir, :exclude_fixtures, :exclude_factories, :ignore_model_sub_dir,
:format_bare, :format_rdoc, :format_markdown, :sort, :force, :trace, :format_bare, :format_rdoc, :format_markdown, :sort, :force, :trace,
:timestamp, :exclude_serializers, :classified_sort, :show_foreign_keys, :timestamp, :exclude_serializers, :classified_sort,
:show_foreign_keys, :show_complete_foreign_keys,
:exclude_scaffolds, :exclude_controllers, :exclude_helpers, :exclude_scaffolds, :exclude_controllers, :exclude_helpers,
:exclude_sti_subclasses, :ignore_unknown_models :exclude_sti_subclasses, :ignore_unknown_models
].freeze ].freeze
......
...@@ -484,6 +484,21 @@ EOS ...@@ -484,6 +484,21 @@ EOS
EOS EOS
end end
describe '#set_defaults' do
it 'should default show_complete_foreign_keys to false' do
expect(Annotate.true?(ENV['show_complete_foreign_keys'])).to be(false)
end
it 'should be able to set show_complete_foreign_keys to true' do
Annotate.set_defaults('show_complete_foreign_keys' => 'true')
expect(Annotate.true?(ENV['show_complete_foreign_keys'])).to be(true)
end
after :each do
ENV.delete('show_complete_foreign_keys')
end
end
describe '#get_schema_info with custom options' do describe '#get_schema_info with custom options' do
def self.when_called_with(options = {}) def self.when_called_with(options = {})
expected = options.delete(:returns) expected = options.delete(:returns)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment