diff options
Diffstat (limited to 'spec/rubocop/cop/active_record_dependent_spec.rb')
-rw-r--r-- | spec/rubocop/cop/active_record_dependent_spec.rb | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/spec/rubocop/cop/active_record_dependent_spec.rb b/spec/rubocop/cop/active_record_dependent_spec.rb deleted file mode 100644 index 599a032bfc5..00000000000 --- a/spec/rubocop/cop/active_record_dependent_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require 'spec_helper' -require 'rubocop' -require 'rubocop/rspec/support' -require_relative '../../../rubocop/cop/active_record_dependent' - -describe RuboCop::Cop::ActiveRecordDependent do - include CopHelper - - subject(:cop) { described_class.new } - - context 'inside the app/models directory' do - it 'registers an offense when dependent: is used' do - allow(cop).to receive(:in_model?).and_return(true) - - inspect_source(cop, 'belongs_to :foo, dependent: :destroy') - - aggregate_failures do - expect(cop.offenses.size).to eq(1) - expect(cop.offenses.map(&:line)).to eq([1]) - end - end - end - - context 'outside the app/models directory' do - it 'does nothing' do - allow(cop).to receive(:in_model?).and_return(false) - - inspect_source(cop, 'belongs_to :foo, dependent: :destroy') - - expect(cop.offenses).to be_empty - end - end -end |