CSC/ECE 517 Fall 2021 - E2121. Refactor suggestion controller.rb

From Expertiza_Wiki
Jump to navigation Jump to search

Introduction

This page provides a description of the Expertiza based OSS project.



About Expertiza

Expertiza is an open-source educational project based on Ruby on Rails framework.

Related Functions

  • Files Involved: suggestion_controller.rb, assignment_team.rb, sign_up_topic.rb, suggestion_controller_spec.rb (create)
  • The following functions are related to E2121:
    • Students could submit suggestions of topic
    • Instructors could approve or reject suggested topics of students
    • Instructors and students could create teams

Tasks Statement

The following tasks were accomplished in this project:

  • Line 76 and 77: use more Ruby-like String concepts
  • Line 94: Refactor create_new_team to assignment_team.rb
  • Line 125: Refactor notification to simplify control logic.
  • Line 160: Refactor approve_suggestion to indicate that notification is being sent.
  • Test functions and increase coverage:
    • Check error in approve
    • Test reject_suggestion
    • Test when topic_id.nil? to make sure the waitlist is cleared.
    • Test the submit, student_view, student_edit, update_suggestion, add_comment function

===Procedure to Test Our project Manually

  • Click the link E2121.
  • 使用流程

Refactor Suggestion Controller.rb

Test by RSpec