E1921 Write tests for popup controller.rb: Difference between revisions
Jump to navigation
Jump to search
(Added outline and test outline) |
(Added introduction) |
||
Line 1: | Line 1: | ||
The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. See the Test Outline section for specifics of our work. | |||
== Project Introduction == | == Project Introduction == | ||
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to '''INSERT%'''. | |||
=== Team === | === Team === |
Revision as of 22:47, 24 March 2019
The goal of this project was to add testing for the PopupController to raise statement coverage above 90%. See the Test Outline section for specifics of our work.
Project Introduction
The PopupController is responsible for preparing data that will be displayed in popup views. To render the data, which mostly concerns assignments, the controller makes many accesses to database tables such as Response, ResponseMap, Question, Questionnaire, Answer, and Participant. Before our project, there were only two tests implemented that together only achieved a statement coverage of 7%. Our changes have brought the statement coverage to INSERT%.
Team
File and Running Tests
Design
Test Outline
The following sections show the Rspec outline of the tests we created.
PopupController
#action_allowed? when the role current user is student does not allow certain action when the role current user is ta allows certain action when the role name of current user is super admin or admin allows certain action when the role current user is super instructor allows certain action
#author_feedback_popup when response_id exists #team_users_popup when a response map exists calculates response stats for one response when a response map does not exist finds team and users
#participants_popup called with no response does not calculate scores called with a response assignment has a review questionnaire calculates the scores with a max assignment has no review questionnaire calculates the scores without a max
tone analysis tests #tone_analysis_chart_popup review tone analysis is calculated prepares tone analysis report for building #build_tone_analysis_report upon selecting summery, the tone analysis for review comments is calculated and applied to the page builds a tone analysis report and returns the heat map URLs #view_review_scores_popup prepares tone analysis report for building #reviewer_details_popup it will show the reviewer details it will show the reviewer details #self_review_popup when response_id exists get the result