diff --git a/Changelog.md b/Changelog.md index 7c20153869..5b344324a8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -16,6 +16,7 @@ - Ensured submissions that have been released cannot be recollected from the repo browser (#7254) - Fix bug where renaming a group to an existing group in a different assignment resulted in incorrect repository mapping (#7224) - Disable editable fields in assignment criterion when criterion is released (#7264) +- Fixed Download One Time Annotation 'Not Found' error (#7302) ### 🔧 Internal changes diff --git a/app/views/annotation_categories/_uncategorized_annotations_list.html.erb b/app/views/annotation_categories/_uncategorized_annotations_list.html.erb index 10cc3b3d4f..2f57b732cc 100644 --- a/app/views/annotation_categories/_uncategorized_annotations_list.html.erb +++ b/app/views/annotation_categories/_uncategorized_annotations_list.html.erb @@ -6,7 +6,6 @@
<%= link_to t('annotations.download_one_time_annotations'), {action: 'uncategorized_annotations', - id: @assignment.id, format: 'csv'}, class: 'button' %>
diff --git a/spec/controllers/annotation_categories_controller_spec.rb b/spec/controllers/annotation_categories_controller_spec.rb index 74d1c030a0..ce416238cf 100644 --- a/spec/controllers/annotation_categories_controller_spec.rb +++ b/spec/controllers/annotation_categories_controller_spec.rb @@ -624,6 +624,24 @@ expect(data.first['submission_id']).to eq(assignment.groupings.first.current_result.submission_id) expect(data.first['id']).to eq(text2.id) end + + describe 'Download One Time Annotations' do + let(:course2) { create(:course) } + let(:assignment2) { create(:assignment, course: course2) } + + it 'should respond with 200' do + get_as role, :uncategorized_annotations, params: { course_id: course.id, assignment_id: assignment.id }, + format: 'csv' + expect(response).to have_http_status(:ok) + end + + it 'should respond with 404' do + get_as role, :uncategorized_annotations, + params: { course_id: course2.id, assignment_id: assignment2.id, id: annotation_category.id }, + format: 'csv' + expect(response).to have_http_status(:not_found) + end + end end describe '#destroy_annotation_text' do