Skip to content

Commit

Permalink
OTWO-7308 Handle name_fact for NilAccountAnalysis (#1799)
Browse files Browse the repository at this point in the history
  • Loading branch information
Priya5 authored Oct 8, 2024
1 parent 14c6900 commit e005068
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/null_models/nil_account_analysis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ def account_analysis_fact
def account_analysis_language_facts
AccountAnalysisLanguageFact.none
end

def name_fact
NilNameFact.new
end
end
5 changes: 5 additions & 0 deletions app/null_models/nil_name_fact.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

class NilNameFact < NullObject
nought_methods :thirty_day_commits
end
6 changes: 6 additions & 0 deletions test/null_models/nil_account_analysis_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@ class NilAccounAnalysisTest < ActiveSupport::TestCase
_(nil_account_analysis.id).must_equal 0
end
end

describe 'name_fact' do
it 'should be nil_name_fact' do
_(nil_account_analysis.name_fact.class).must_equal NilNameFact
end
end
end

0 comments on commit e005068

Please sign in to comment.