author thumb

Hello, my name is Zhewei Hu
Incoming SRE@Pinterest |
Ph.D. student@NCSU |
SRE Intern’18@Procore |
SDE Intern’17@IBM |
SDE Intern’16@Offers.com

Users Controller Refactoring in Expertiza (OSS)

Description

  • Find the un-called methods if any and delete them.
  • Change the Rails 2 syntax to Rails 4 style.
  • Refactor users_controller.rb
  • Change the white space for the second half of this file, starts at “def edit”.
  • Separate the paginate_list method into two methods. The search method should be in model and the paginating method should be in the controller.
  • New feature: delete users
    • A user can be deleted if (s)he has not participated in an assignment.
    • If the user is participating in an assignment, the system will ask, “User is participating in k assignments. Delete as a participant in these assignment(s)?”
    • If the user has submitted or reviewed in any of these assignments, the system will say the user cannot be deleted, but offer to rename the user account to _hidden.
      • rename (javascript calling update method in users_controller.rb)
      • different users have different delete methods.
    • If the person trying to delete does not want to rename the account, the system will just say that the user can’t be deleted.
  • Write Rspec unit test and increase the test coverage to 28%.

/end