Skip to content

Commit

Permalink
test: fix tests to conform to new validations
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Jul 26, 2024
1 parent edcd36a commit 527b810
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 15 deletions.
23 changes: 14 additions & 9 deletions test/api/tii/tii_action_api_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,20 @@ def app
# Create a task definition with two attachments
@unit = FactoryBot.create(:unit, with_students: false, task_count: 0)

@task_def = FactoryBot.create(:task_definition, unit: @unit, upload_requirements: [
{
'key' => 'file0',
'name' => 'My document',
'type' => 'document',
'tii_check' => 'true',
'tii_pct' => '10'
}
])
@task_def = FactoryBot.create(
:task_definition,
unit: @unit,
upload_requirements:
[
{
'key' => 'file0',
'name' => 'My document',
'type' => 'document',
'tii_check' => true,
'tii_pct' => 10
}
]
)

ga1 = TiiGroupAttachment.create(
task_definition: @task_def,
Expand Down
2 changes: 1 addition & 1 deletion test/models/task_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class TaskDefinitionTest < ActiveSupport::TestCase
include TestHelpers::AuthHelper
include TestHelpers::JsonHelper

def error! msg
def error! msg, code
raise msg
end

Expand Down
8 changes: 4 additions & 4 deletions test/sidekiq/tii_check_progress_job_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def test_check_eula_change
'key' => 'file0',
'name' => 'My document',
'type' => 'document',
'tii_check' => 'true',
'tii_pct' => '10'
'tii_check' => true,
'tii_pct' => 10
}
])

Expand Down Expand Up @@ -150,8 +150,8 @@ def test_that_progress_checks_eula_change
'key' => 'file0',
'name' => 'My document',
'type' => 'document',
'tii_check' => 'true',
'tii_pct' => '10'
'tii_check' => true,
'tii_pct' => 10
}
])

Expand Down
2 changes: 1 addition & 1 deletion test/sidekiq/tii_webhooks_job_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_register_webhooks
.with(tii_headers)
.with(
body: TCAClient::WebhookWithSecret.new(
signing_secret: Base64.encode64(ENV.fetch('TCA_SIGNING_KEY', nil)),
signing_secret: Base64.encode64(ENV.fetch('TCA_SIGNING_KEY', nil)).tr("\n", '' ),
url: TurnItIn.webhook_url,
event_types: [
'SIMILARITY_COMPLETE',
Expand Down

0 comments on commit 527b810

Please sign in to comment.