-
Notifications
You must be signed in to change notification settings - Fork 221
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
Second Batch of Submissions Tests #2132
Conversation
WalkthroughWalkthroughThis update enhances submission handling in the application by improving clarity in the codebase, particularly concerning student submissions. It introduces clearer naming conventions, expands testing coverage for various submission-related actions across different user roles, and implements functionality for downloading and managing submissions. These changes streamline workflows and ensure comprehensive testing scenarios. Changes
Possibly related issues
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional comments not posted (4)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm! left some nits about test naming
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (2)
spec/controllers/submissions_controller_spec.rb (2)
259-275
: Improve test efficiency.Avoid writing and deleting a file in the
tmp
directory. Instead, validate the response content directly.Apply this diff to improve the test efficiency:
- File.binwrite("tmp/test2.zip", response.parsed_body) - Zip::File.open("tmp/test2.zip") do |zip_file| + Zip::File.open_buffer(response.parsed_body) do |zip_file| zip_file.each do |entry| if entry.file? content = entry.get_input_stream.read expect(content).to match(/Hello Dave/m) end end end - File.delete("tmp/test2.zip")
279-301
: Improve test efficiency.Avoid writing and deleting a file in the
tmp
directory. Instead, validate the response content directly.Apply this diff to improve the test efficiency:
- File.binwrite("tmp/test.c", response.parsed_body) - File.open("tmp/test.c") do |file| - file_data = file.read + file_data = response.parsed_body expect(file_data).to match(/Hello Dave/m) - end
Description
create_course_no_submissions_hash
to have a test course with no submissionsHow Has This Been Tested?
Run the tests, see that they pass
Types of changes
Checklist:
overcommit --install && overcommit --sign
to use pre-commit hook for linting