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
Assessments: Set up basic controller tests #23036
Conversation
test 'verified teacher can get assessment questions and answers' do | ||
sign_in @teacher | ||
get :index, params: {section_id: @section.id, script_id: 2} | ||
assert_response :success |
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.
i would add an assertion here to make sure you get the assessment(s) you expect from the index action
test 'verified teacher can get assessment responses from students' do | ||
sign_in @teacher | ||
get :section_responses, params: {section_id: @section.id, script_id: 2} | ||
assert_response :success |
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.
same as comment above - just make sure the correct section responses come back as well
@madelynkasula updated! |
@caleybrock i think having both endpoints return some data would be really useful for these tests. something like this: code-dot-org/dashboard/test/controllers/api/v1/sections_controller_test.rb Lines 46 to 54 in 1c67af3
that file and the courses_controller_test.rb have a lot of good examples of this |
I totally agree. The goal is for these to come later, I just wanted to first ensure the authentication is correct first. |
Early version of controller tests for assessments. This only includes authentication tests. I wanted to set these up before I start moving some logic out of the controllers and into the models.