Skip to content

Commit

Permalink
Adding missing tests. (#2154)
Browse files Browse the repository at this point in the history
Adding missing tests in order to complete code coverage.

Reference: CV2-5830.
  • Loading branch information
caiosba authored Dec 15, 2024
1 parent b3f5756 commit d08f344
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
5 changes: 5 additions & 0 deletions test/lib/check_search_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,9 @@ def teardown
search = CheckSearch.new({ keyword: query }.to_json, nil, @team.id)
assert_equal 'Something is going to happen on 04 11 reportedly', search.instance_variable_get('@options')['keyword']
end

test "should search for array field containing nil values" do
search = CheckSearch.new({ users: [1, nil] }.to_json, nil, @team.id)
assert_not_nil search.send(:doc_conditions)
end
end
5 changes: 5 additions & 0 deletions test/models/fact_check_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -728,4 +728,9 @@ def setup
assert_nil pm.reload.fact_check_id
end
end

test "should be formatted as tipline search result" do
fc = create_fact_check
assert_kind_of TiplineSearchResult, fc.as_tipline_search_result
end
end
7 changes: 7 additions & 0 deletions test/models/project_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -645,4 +645,11 @@ def setup
p = create_project team: t
assert p.inactive
end

test "should get and set current project" do
p = create_project
assert_nil Project.current
Project.current = p
assert_equal p, Project.current
end
end
2 changes: 1 addition & 1 deletion test/workers/project_media_trash_worker_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

class ProjectMediaTrashWorkerTest < ActiveSupport::TestCase
def setup
super
require 'sidekiq/testing'
Sidekiq::Testing.inline!
Team.current = User.current = nil
end

test "should destroy trashed items" do
Expand Down

0 comments on commit d08f344

Please sign in to comment.