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

Fix lecture edit page if active term is not set #683

Merged
merged 9 commits into from
Aug 21, 2024

Conversation

fosterfarrell9
Copy link
Collaborator

This fixes #682 by adding the missing case in the older_than? method in the Lecture model.

Copy link
Member

@Splines Splines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

  • Maybe you can add an end-to-end test to ensure that the lecture#edit page looks as expected? (instead of showing an error?)
  • And maybe even add a unit test for the lecture.stale? method to ensure it gives proper results even in the case where we just have a lecture and not an active term set.

@fosterfarrell9
Copy link
Collaborator Author

I added unit tests for lecture#stale?, made lecture#older_than? private (it is not used anywhere except by the lecture#stale? method) and added a cypress test for the lecture edit page that should fail when the page throws an error.

spec/cypress/e2e/lecture_spec.cy.js Outdated Show resolved Hide resolved
spec/cypress/e2e/lecture_spec.cy.js Outdated Show resolved Hide resolved
app/models/lecture.rb Show resolved Hide resolved
spec/models/lecture_spec.rb Outdated Show resolved Hide resolved
spec/cypress/e2e/lecture_spec.cy.js Outdated Show resolved Hide resolved
Copy link
Member

@Splines Splines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Note that you'll have to approve the tests such that they can run through before merging via Squash and merge.

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (dev@0d39b9e). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             dev     #683   +/-   ##
======================================
  Coverage       ?   53.86%           
======================================
  Files          ?      157           
  Lines          ?     6645           
  Branches       ?        0           
======================================
  Hits           ?     3579           
  Misses         ?     3066           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fosterfarrell9 fosterfarrell9 merged commit 6d09e9e into dev Aug 21, 2024
5 checks passed
@fosterfarrell9 fosterfarrell9 deleted the fix/lecture-edit-without-active-term branch August 21, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants