Skip to content

Commit 0a1c0e3

Browse files
authored
Research Export Fix (#2416)
* Don't blow up on nil step.exercise_url * Fixed flaky practice question exercises spec
1 parent 8e7f02c commit 0a1c0e3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/routines/export_and_upload_research_data.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def create_tutor_export_file(filename, task_types, date_range)
194194

195195
row.concat(
196196
step.exercise? ? [
197-
"#{step.exercise_url.gsub('org', 'org/api')}.json",
197+
"#{step.exercise_url&.gsub('org', 'org/api')}.json",
198198
step.exercise_url,
199199
array_decoder.decode(step.tags_array).join(','),
200200
step.question_index.to_i + 1,

spec/routines/get_practice_question_exercises_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161
course: course
6262
).outputs
6363

64-
expect(outputs.exercises.map(&:id)).to eq([old_exercise.id, new_exercise.id])
64+
expect(Set.new outputs.exercises.map(&:id)).to eq(Set[old_exercise.id, new_exercise.id])
6565
end
6666
end

0 commit comments

Comments
 (0)