Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5514 – Import fact-check as published report #2094

Merged
merged 3 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/bot/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def self.set_claim_and_fact_check(claim_review, pm, user, team)
fc.user = user
fc.language = fc_language
fc.publish_report = true
fc.report_status = "published"
fc.save!
User.current = current_user
end
Expand Down
14 changes: 14 additions & 0 deletions test/models/bot/fetch_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -253,4 +253,18 @@ def setup
Bot::Fetch::Import.import_claim_review(cr, @team.id, @bot.id, 'undetermined', {}, false)
end
end

test "should import claim review as published report" do
cr = @claim_review.deep_dup
cr['identifier'] = random_string
assert_difference 'FactCheck.count' do
Bot::Fetch::Import.import_claim_review(cr, @team.id, @bot.id, 'undetermined', {}, false)
end

r = Dynamic.where(annotation_type: 'report_design').last
assert_equal "published", r.state

fc = FactCheck.last
assert_equal "published", fc.report_status
end
end
Loading