<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dtjordan</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dtjordan"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Dtjordan"/>
	<updated>2026-07-15T05:03:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135714</id>
		<title>CSC/ECE 517 Fall 2020 - E2069. refactor suggestions controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135714"/>
		<updated>2020-10-20T03:21:10Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
The '''suggestions_controller.rb''' of Expertiza is involved in creating/editing suggestions topic suggestions for a project and involved approvals. Students can submit suggestions and work on them if approved. &lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
We intend to improve the readability and code quality of the suggestions_controller.rb. Since this controller has methods that must actually be done by other classes (owing to Single Responsibility feature of the SOLID principles), we have realized the need to move these methods to their respective classes.&lt;br /&gt;
&lt;br /&gt;
== Issues to Fix ==&lt;br /&gt;
1. Move the method '''create_new_team''' (on line 94) to a more appropriate class.&lt;br /&gt;
(Ex: '''Team.rb''' or '''AssignmentTeam.rb''')&lt;br /&gt;
&lt;br /&gt;
2. Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.&lt;br /&gt;
&lt;br /&gt;
3. There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.&lt;br /&gt;
&lt;br /&gt;
4. Move the '''send_email''' method to the '''Mailer''' class in '''app/mailers/mailer.rb'''.&lt;br /&gt;
&lt;br /&gt;
5. In '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''', there seems to be a DRY violation which needs to be fixed. Merge both files into a single view file in order to fix the DRY problem.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
*app/controllers/teams_controllers.rb&lt;br /&gt;
*app/models/sign_up_topic.rb&lt;br /&gt;
*app/mailers/mailer.rb&lt;br /&gt;
*views/suggestion/show.html.erb&lt;br /&gt;
&lt;br /&gt;
== Code Review ==&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''create_new_team''' to a more appropriate class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to '''assignment_team.rb''' since it is appropriate.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip2.PNG]]&lt;br /&gt;
&lt;br /&gt;
We pass the required variables inside the scope of this function as method parameters.&lt;br /&gt;
Then we call the new method as a method of the '''AssignmentTeam''' class.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip3.PNG]]&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ApproveMethod2.png]]&lt;br /&gt;
&lt;br /&gt;
First, we moved everything in the approve method from '''suggestion_controller''' having to do with a sign up topic to its own new method in '''sign_up_topic.rb''' now called '''new_topic_from_suggestion'''. In doing so, we also delete the entire '''approve method''' from '''suggestion_controller''', since refactoring for that method happens concurrently as a result of another issue in this project. &lt;br /&gt;
&lt;br /&gt;
'''''Issue''':There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.''&lt;br /&gt;
&lt;br /&gt;
[[File:ApproveMethod.png]]&lt;br /&gt;
&lt;br /&gt;
Here, we changed the name of '''approve_suggestion''' to '''approve_suggestion_and_notify''', since it really seems like this method is both to handle approving a suggestion as well as calling the notification method from elsewhere in the controller class. We also add in the first part of the original &amp;quot;approve&amp;quot; method here, so that we can set the instance variables that suggestion_controller might need ('''@user_id, @team_id, and @topic_id''') as well as calling our newly created '''new_topic_from_suggestion''' method in '''SignUpTopic''' with the proper suggestion passed as a parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the '''send_email''' method to the '''Mailer''' class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to the '''Mailer.rb''' file which seems to have many built-in functionalities for mail services.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip1.PNG]]&lt;br /&gt;
&lt;br /&gt;
Next, the required variables for this method were passed as parameters from '''suggestion_controller''' and is called as a method of Mailer class&lt;br /&gt;
&lt;br /&gt;
[[File:Snip4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Merge '''app/views/suggestion/show.html.erb''' and '''app/views/suggestion/student_view.html.erb''' into one view.&lt;br /&gt;
&lt;br /&gt;
Modify student_view method in suggestion controller to provide '''@current_role_name''' and '''render show''' template.&lt;br /&gt;
&lt;br /&gt;
[[File:modified show student.png]]&lt;br /&gt;
&lt;br /&gt;
Migrate code from '''student_view.html.erb''' to '''show.html.erb''' and wrap in an if statement that will display view only if user role is a student.&lt;br /&gt;
&lt;br /&gt;
[[File:Student_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Move the rest of the remaining code from the original show template to the else block.&lt;br /&gt;
&lt;br /&gt;
[[File:Show_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Delete the '''student_view.html.erb''' file since all of it's contents are contained within the '''show.html.erb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Deleted Student_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
== How to Check ==&lt;br /&gt;
&lt;br /&gt;
Since only the code style/process was changed, the expected functionality before and after, will be the same. Student should be able to create a suggestion for an assignment, just like before.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor. &lt;br /&gt;
&lt;br /&gt;
*Login with username '''instructor6''' and password '''password'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Login.jpg|1200px]]&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment.&lt;br /&gt;
&lt;br /&gt;
*Click the '''Assignments''' link.&lt;br /&gt;
&lt;br /&gt;
[[File:Click_assignments.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Click the '''+''' icon.&lt;br /&gt;
&lt;br /&gt;
[[File:Click_plus_icon.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
3. Fill in the following fields in the ''''General'''' tab.&lt;br /&gt;
&lt;br /&gt;
*Provide '''Assignment name'''.&lt;br /&gt;
*Check the '''Has Teams''' checkbox and set maximum number of members to greater than or equal to 1.&lt;br /&gt;
*Click the '''Create''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:General_tab.png]]&lt;br /&gt;
&lt;br /&gt;
*Page will reload and have an additional checkbox, '''Has topics?'''. Check it off and click the '''Save''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Has_topics.png]]&lt;br /&gt;
&lt;br /&gt;
4. Make the following selections in the '''Topics''' tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Topics_tab.png|600px]]&lt;br /&gt;
&lt;br /&gt;
5. Assign this assignment to a student belonging to this instructor&lt;br /&gt;
&lt;br /&gt;
*Select '''Add participant''' link within the '''Other stuff''' tab. This will bring you to a new page. &lt;br /&gt;
&lt;br /&gt;
[[File:Other_stuff.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
*Find student of interest (we recommend using '''student1876'''). Select '''Add''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Find_student.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*You should receive confirmation of successfully adding the student to the assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Add_student_confirmation.png|800px]]&lt;br /&gt;
&lt;br /&gt;
6. Impersonate the assigned student.&lt;br /&gt;
&lt;br /&gt;
*Select from the Manage dropdown menu '''Impersonate User'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate_student.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Fill in field with student username and select '''Impersonate''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate_student_fill_in.png|800px]]&lt;br /&gt;
&lt;br /&gt;
7. Let the student view this assignment (may need to register too)&lt;br /&gt;
&lt;br /&gt;
*Select the created assignment from the table seen at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
[[File:Select_new_assignment.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Select '''Suggest a topic''' link.&lt;br /&gt;
&lt;br /&gt;
[[File:Suggest_topic.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*Create new suggestion, provide a title, description, and click the '''Submit''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Student_suggestion.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*Select '''View''' link for the suggestion created.&lt;br /&gt;
&lt;br /&gt;
[[File:View student_suggestion.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*This will bring the following page that &lt;br /&gt;
&lt;br /&gt;
8. Check that suggestion is shown after creation (like above picture)&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
&lt;br /&gt;
The demonstration shown in the above section is how we tested the functionality and behavior of our changes.&lt;br /&gt;
The spec tests below will test that the moved methods work independently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This test ensures the working of the mailer method for approved suggestions&lt;br /&gt;
&lt;br /&gt;
[[File:Mailer test.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This test ensures the working of the team creation method&lt;br /&gt;
&lt;br /&gt;
[[File:spec2.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[http://152.7.99.171:8080/ Our Deployed Expertiza]&lt;br /&gt;
*[https://github.com/GitHubSanti/expertiza/tree/beta Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
*Varun Varadarajan (vvarada2)&lt;br /&gt;
*Dylan Jordan (dtjordan)&lt;br /&gt;
*Santiago Sepulveda (sasepulv)&lt;br /&gt;
*'''Mentor:''' Sanket Pai (sgpai2)&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:ApproveMethod2.png&amp;diff=135713</id>
		<title>File:ApproveMethod2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:ApproveMethod2.png&amp;diff=135713"/>
		<updated>2020-10-20T03:20:35Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135712</id>
		<title>CSC/ECE 517 Fall 2020 - E2069. refactor suggestions controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135712"/>
		<updated>2020-10-20T03:19:37Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
The '''suggestions_controller.rb''' of Expertiza is involved in creating/editing suggestions topic suggestions for a project and involved approvals. Students can submit suggestions and work on them if approved. &lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
We intend to improve the readability and code quality of the suggestions_controller.rb. Since this controller has methods that must actually be done by other classes (owing to Single Responsibility feature of the SOLID principles), we have realized the need to move these methods to their respective classes.&lt;br /&gt;
&lt;br /&gt;
== Issues to Fix ==&lt;br /&gt;
1. Move the method '''create_new_team''' (on line 94) to a more appropriate class.&lt;br /&gt;
(Ex: '''Team.rb''' or '''AssignmentTeam.rb''')&lt;br /&gt;
&lt;br /&gt;
2. Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.&lt;br /&gt;
&lt;br /&gt;
3. There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.&lt;br /&gt;
&lt;br /&gt;
4. Move the '''send_email''' method to the '''Mailer''' class in '''app/mailers/mailer.rb'''.&lt;br /&gt;
&lt;br /&gt;
5. In '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''', there seems to be a DRY violation which needs to be fixed. Merge both files into a single view file in order to fix the DRY problem.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
*app/controllers/teams_controllers.rb&lt;br /&gt;
*app/models/sign_up_topic.rb&lt;br /&gt;
*app/mailers/mailer.rb&lt;br /&gt;
*views/suggestion/show.html.erb&lt;br /&gt;
&lt;br /&gt;
== Code Review ==&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''create_new_team''' to a more appropriate class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to '''assignment_team.rb''' since it is appropriate.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip2.PNG]]&lt;br /&gt;
&lt;br /&gt;
We pass the required variables inside the scope of this function as method parameters.&lt;br /&gt;
Then we call the new method as a method of the '''AssignmentTeam''' class.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip3.PNG]]&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ApproveMethod.png]]&lt;br /&gt;
&lt;br /&gt;
First, we moved everything in the approve method from '''suggestion_controller''' having to do with a sign up topic to its own new method in '''sign_up_topic.rb''' now called '''new_topic_from_suggestion'''. In doing so, we also delete the entire '''approve method''' from '''suggestion_controller''', since refactoring for that method happens concurrently as a result of another issue in this project. &lt;br /&gt;
&lt;br /&gt;
'''''Issue''':There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.''&lt;br /&gt;
&lt;br /&gt;
[[File:newscreenshot2.png]]&lt;br /&gt;
&lt;br /&gt;
Here, we changed the name of '''approve_suggestion''' to '''approve_suggestion_and_notify''', since it really seems like this method is both to handle approving a suggestion as well as calling the notification method from elsewhere in the controller class. We also add in the first part of the original &amp;quot;approve&amp;quot; method here, so that we can set the instance variables that suggestion_controller might need ('''@user_id, @team_id, and @topic_id''') as well as calling our newly created '''new_topic_from_suggestion''' method in '''SignUpTopic''' with the proper suggestion passed as a parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the '''send_email''' method to the '''Mailer''' class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to the '''Mailer.rb''' file which seems to have many built-in functionalities for mail services.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip1.PNG]]&lt;br /&gt;
&lt;br /&gt;
Next, the required variables for this method were passed as parameters from '''suggestion_controller''' and is called as a method of Mailer class&lt;br /&gt;
&lt;br /&gt;
[[File:Snip4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Merge '''app/views/suggestion/show.html.erb''' and '''app/views/suggestion/student_view.html.erb''' into one view.&lt;br /&gt;
&lt;br /&gt;
Modify student_view method in suggestion controller to provide '''@current_role_name''' and '''render show''' template.&lt;br /&gt;
&lt;br /&gt;
[[File:modified show student.png]]&lt;br /&gt;
&lt;br /&gt;
Migrate code from '''student_view.html.erb''' to '''show.html.erb''' and wrap in an if statement that will display view only if user role is a student.&lt;br /&gt;
&lt;br /&gt;
[[File:Student_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Move the rest of the remaining code from the original show template to the else block.&lt;br /&gt;
&lt;br /&gt;
[[File:Show_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Delete the '''student_view.html.erb''' file since all of it's contents are contained within the '''show.html.erb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Deleted Student_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
== How to Check ==&lt;br /&gt;
&lt;br /&gt;
Since only the code style/process was changed, the expected functionality before and after, will be the same. Student should be able to create a suggestion for an assignment, just like before.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor. &lt;br /&gt;
&lt;br /&gt;
*Login with username '''instructor6''' and password '''password'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Login.jpg|1200px]]&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment.&lt;br /&gt;
&lt;br /&gt;
*Click the '''Assignments''' link.&lt;br /&gt;
&lt;br /&gt;
[[File:Click_assignments.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Click the '''+''' icon.&lt;br /&gt;
&lt;br /&gt;
[[File:Click_plus_icon.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
3. Fill in the following fields in the ''''General'''' tab.&lt;br /&gt;
&lt;br /&gt;
*Provide '''Assignment name'''.&lt;br /&gt;
*Check the '''Has Teams''' checkbox and set maximum number of members to greater than or equal to 1.&lt;br /&gt;
*Click the '''Create''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:General_tab.png]]&lt;br /&gt;
&lt;br /&gt;
*Page will reload and have an additional checkbox, '''Has topics?'''. Check it off and click the '''Save''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Has_topics.png]]&lt;br /&gt;
&lt;br /&gt;
4. Make the following selections in the '''Topics''' tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Topics_tab.png|600px]]&lt;br /&gt;
&lt;br /&gt;
5. Assign this assignment to a student belonging to this instructor&lt;br /&gt;
&lt;br /&gt;
*Select '''Add participant''' link within the '''Other stuff''' tab. This will bring you to a new page. &lt;br /&gt;
&lt;br /&gt;
[[File:Other_stuff.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
*Find student of interest (we recommend using '''student1876'''). Select '''Add''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Find_student.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*You should receive confirmation of successfully adding the student to the assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Add_student_confirmation.png|800px]]&lt;br /&gt;
&lt;br /&gt;
6. Impersonate the assigned student.&lt;br /&gt;
&lt;br /&gt;
*Select from the Manage dropdown menu '''Impersonate User'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate_student.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Fill in field with student username and select '''Impersonate''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate_student_fill_in.png|800px]]&lt;br /&gt;
&lt;br /&gt;
7. Let the student view this assignment (may need to register too)&lt;br /&gt;
&lt;br /&gt;
*Select the created assignment from the table seen at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
[[File:Select_new_assignment.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Select '''Suggest a topic''' link.&lt;br /&gt;
&lt;br /&gt;
[[File:Suggest_topic.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*Create new suggestion, provide a title, description, and click the '''Submit''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Student_suggestion.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*Select '''View''' link for the suggestion created.&lt;br /&gt;
&lt;br /&gt;
[[File:View student_suggestion.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*This will bring the following page that &lt;br /&gt;
&lt;br /&gt;
8. Check that suggestion is shown after creation (like above picture)&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
&lt;br /&gt;
The demonstration shown in the above section is how we tested the functionality and behavior of our changes.&lt;br /&gt;
The spec tests below will test that the moved methods work independently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This test ensures the working of the mailer method for approved suggestions&lt;br /&gt;
&lt;br /&gt;
[[File:Mailer test.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This test ensures the working of the team creation method&lt;br /&gt;
&lt;br /&gt;
[[File:spec2.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[http://152.7.99.171:8080/ Our Deployed Expertiza]&lt;br /&gt;
*[https://github.com/GitHubSanti/expertiza/tree/beta Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
*Varun Varadarajan (vvarada2)&lt;br /&gt;
*Dylan Jordan (dtjordan)&lt;br /&gt;
*Santiago Sepulveda (sasepulv)&lt;br /&gt;
*'''Mentor:''' Sanket Pai (sgpai2)&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:ApproveMethod.png&amp;diff=135711</id>
		<title>File:ApproveMethod.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:ApproveMethod.png&amp;diff=135711"/>
		<updated>2020-10-20T03:18:32Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135709</id>
		<title>CSC/ECE 517 Fall 2020 - E2069. refactor suggestions controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135709"/>
		<updated>2020-10-20T03:18:12Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
The '''suggestions_controller.rb''' of Expertiza is involved in creating/editing suggestions topic suggestions for a project and involved approvals. Students can submit suggestions and work on them if approved. &lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
We intend to improve the readability and code quality of the suggestions_controller.rb. Since this controller has methods that must actually be done by other classes (owing to Single Responsibility feature of the SOLID principles), we have realized the need to move these methods to their respective classes.&lt;br /&gt;
&lt;br /&gt;
== Issues to Fix ==&lt;br /&gt;
1. Move the method '''create_new_team''' (on line 94) to a more appropriate class.&lt;br /&gt;
(Ex: '''Team.rb''' or '''AssignmentTeam.rb''')&lt;br /&gt;
&lt;br /&gt;
2. Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.&lt;br /&gt;
&lt;br /&gt;
3. There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.&lt;br /&gt;
&lt;br /&gt;
4. Move the '''send_email''' method to the '''Mailer''' class in '''app/mailers/mailer.rb'''.&lt;br /&gt;
&lt;br /&gt;
5. In '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''', there seems to be a DRY violation which needs to be fixed. Merge both files into a single view file in order to fix the DRY problem.&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
*app/controllers/teams_controllers.rb&lt;br /&gt;
*app/models/sign_up_topic.rb&lt;br /&gt;
*app/mailers/mailer.rb&lt;br /&gt;
*views/suggestion/show.html.erb&lt;br /&gt;
&lt;br /&gt;
== Code Review ==&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''create_new_team''' to a more appropriate class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to '''assignment_team.rb''' since it is appropriate.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip2.PNG]]&lt;br /&gt;
&lt;br /&gt;
We pass the required variables inside the scope of this function as method parameters.&lt;br /&gt;
Then we call the new method as a method of the '''AssignmentTeam''' class.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip3.PNG]]&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:newScreenshot.png]]&lt;br /&gt;
&lt;br /&gt;
First, we moved everything in the approve method from '''suggestion_controller''' having to do with a sign up topic to its own new method in '''sign_up_topic.rb''' now called '''new_topic_from_suggestion'''. In doing so, we also delete the entire '''approve method''' from '''suggestion_controller''', since refactoring for that method happens concurrently as a result of another issue in this project. &lt;br /&gt;
&lt;br /&gt;
'''''Issue''':There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.''&lt;br /&gt;
&lt;br /&gt;
[[File:newscreenshot2.png]]&lt;br /&gt;
&lt;br /&gt;
Here, we changed the name of '''approve_suggestion''' to '''approve_suggestion_and_notify''', since it really seems like this method is both to handle approving a suggestion as well as calling the notification method from elsewhere in the controller class. We also add in the first part of the original &amp;quot;approve&amp;quot; method here, so that we can set the instance variables that suggestion_controller might need ('''@user_id, @team_id, and @topic_id''') as well as calling our newly created '''new_topic_from_suggestion''' method in '''SignUpTopic''' with the proper suggestion passed as a parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the '''send_email''' method to the '''Mailer''' class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to the '''Mailer.rb''' file which seems to have many built-in functionalities for mail services.&lt;br /&gt;
&lt;br /&gt;
[[File:Snip1.PNG]]&lt;br /&gt;
&lt;br /&gt;
Next, the required variables for this method were passed as parameters from '''suggestion_controller''' and is called as a method of Mailer class&lt;br /&gt;
&lt;br /&gt;
[[File:Snip4.PNG]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Merge '''app/views/suggestion/show.html.erb''' and '''app/views/suggestion/student_view.html.erb''' into one view.&lt;br /&gt;
&lt;br /&gt;
Modify student_view method in suggestion controller to provide '''@current_role_name''' and '''render show''' template.&lt;br /&gt;
&lt;br /&gt;
[[File:modified show student.png]]&lt;br /&gt;
&lt;br /&gt;
Migrate code from '''student_view.html.erb''' to '''show.html.erb''' and wrap in an if statement that will display view only if user role is a student.&lt;br /&gt;
&lt;br /&gt;
[[File:Student_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Move the rest of the remaining code from the original show template to the else block.&lt;br /&gt;
&lt;br /&gt;
[[File:Show_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
Delete the '''student_view.html.erb''' file since all of it's contents are contained within the '''show.html.erb''' file.&lt;br /&gt;
&lt;br /&gt;
[[File:Deleted Student_View.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
== How to Check ==&lt;br /&gt;
&lt;br /&gt;
Since only the code style/process was changed, the expected functionality before and after, will be the same. Student should be able to create a suggestion for an assignment, just like before.&lt;br /&gt;
&lt;br /&gt;
1. Log in as an instructor. &lt;br /&gt;
&lt;br /&gt;
*Login with username '''instructor6''' and password '''password'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Login.jpg|1200px]]&lt;br /&gt;
&lt;br /&gt;
2. Create a new assignment.&lt;br /&gt;
&lt;br /&gt;
*Click the '''Assignments''' link.&lt;br /&gt;
&lt;br /&gt;
[[File:Click_assignments.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Click the '''+''' icon.&lt;br /&gt;
&lt;br /&gt;
[[File:Click_plus_icon.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
3. Fill in the following fields in the ''''General'''' tab.&lt;br /&gt;
&lt;br /&gt;
*Provide '''Assignment name'''.&lt;br /&gt;
*Check the '''Has Teams''' checkbox and set maximum number of members to greater than or equal to 1.&lt;br /&gt;
*Click the '''Create''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:General_tab.png]]&lt;br /&gt;
&lt;br /&gt;
*Page will reload and have an additional checkbox, '''Has topics?'''. Check it off and click the '''Save''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Has_topics.png]]&lt;br /&gt;
&lt;br /&gt;
4. Make the following selections in the '''Topics''' tab.&lt;br /&gt;
&lt;br /&gt;
[[File:Topics_tab.png|600px]]&lt;br /&gt;
&lt;br /&gt;
5. Assign this assignment to a student belonging to this instructor&lt;br /&gt;
&lt;br /&gt;
*Select '''Add participant''' link within the '''Other stuff''' tab. This will bring you to a new page. &lt;br /&gt;
&lt;br /&gt;
[[File:Other_stuff.png|1000px]]&lt;br /&gt;
&lt;br /&gt;
*Find student of interest (we recommend using '''student1876'''). Select '''Add''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Find_student.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*You should receive confirmation of successfully adding the student to the assignment.&lt;br /&gt;
&lt;br /&gt;
[[File:Add_student_confirmation.png|800px]]&lt;br /&gt;
&lt;br /&gt;
6. Impersonate the assigned student.&lt;br /&gt;
&lt;br /&gt;
*Select from the Manage dropdown menu '''Impersonate User'''.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate_student.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Fill in field with student username and select '''Impersonate''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Impersonate_student_fill_in.png|800px]]&lt;br /&gt;
&lt;br /&gt;
7. Let the student view this assignment (may need to register too)&lt;br /&gt;
&lt;br /&gt;
*Select the created assignment from the table seen at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
[[File:Select_new_assignment.png|1200px]]&lt;br /&gt;
&lt;br /&gt;
*Select '''Suggest a topic''' link.&lt;br /&gt;
&lt;br /&gt;
[[File:Suggest_topic.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*Create new suggestion, provide a title, description, and click the '''Submit''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:Student_suggestion.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*Select '''View''' link for the suggestion created.&lt;br /&gt;
&lt;br /&gt;
[[File:View student_suggestion.png|800px]]&lt;br /&gt;
&lt;br /&gt;
*This will bring the following page that &lt;br /&gt;
&lt;br /&gt;
8. Check that suggestion is shown after creation (like above picture)&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
&lt;br /&gt;
The demonstration shown in the above section is how we tested the functionality and behavior of our changes.&lt;br /&gt;
The spec tests below will test that the moved methods work independently.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This test ensures the working of the mailer method for approved suggestions&lt;br /&gt;
&lt;br /&gt;
[[File:Mailer test.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This test ensures the working of the team creation method&lt;br /&gt;
&lt;br /&gt;
[[File:spec2.png]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
*[http://152.7.99.171:8080/ Our Deployed Expertiza]&lt;br /&gt;
*[https://github.com/GitHubSanti/expertiza/tree/beta Expertiza on GitHub]&lt;br /&gt;
&lt;br /&gt;
== Team Members ==&lt;br /&gt;
*Varun Varadarajan (vvarada2)&lt;br /&gt;
*Dylan Jordan (dtjordan)&lt;br /&gt;
*Santiago Sepulveda (sasepulv)&lt;br /&gt;
*'''Mentor:''' Sanket Pai (sgpai2)&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135154</id>
		<title>CSC/ECE 517 Fall 2020 - E2069. refactor suggestions controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135154"/>
		<updated>2020-10-14T03:42:21Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: Formatted base wiki page after all issues added&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
The '''suggestions_controller.rb''' of Expertiza is involved in creating/editing suggestions topic suggestions for a project and involved approvals. Students can submit suggestions and work on them if approved. &lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
We intend to improve the readability and code quality of the suggestions_controller.rb. Since this controller has methods that must actually be done by other classes (owing to Single Responsibility feature of the SOLID principles), we have realized the need to move these methods to their respective classes.&lt;br /&gt;
&lt;br /&gt;
== Issues to Fix ==&lt;br /&gt;
1. Move the method '''create_new_team''' (on line 94) to a more appropriate class.&lt;br /&gt;
(Ex: '''Team.rb''' or '''AssignmentTeam.rb''')&lt;br /&gt;
&lt;br /&gt;
2. Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.&lt;br /&gt;
&lt;br /&gt;
3. There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.&lt;br /&gt;
&lt;br /&gt;
4. Move the '''send_email''' method to the '''Mailer''' class in '''app/mailers/mailer.rb'''.&lt;br /&gt;
&lt;br /&gt;
5. In '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''', there seems to be a DRY violation which needs to be fixed. Merge both files into a single view file in order to fix the DRY problem.&lt;br /&gt;
&lt;br /&gt;
== Code Review ==&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''create_new_team''' to a more appropriate class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to '''teams_controller.rb''' since it is appropriate.&lt;br /&gt;
&lt;br /&gt;
[[File:Image 2020-10-13 223836.png]]&lt;br /&gt;
&lt;br /&gt;
We pass the required variables inside the scope of this function as method parameters.&lt;br /&gt;
Then we call the new method as a method of the Team class.&lt;br /&gt;
&lt;br /&gt;
[[File:Image_2020-10-13_224304.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SignUpTopic_approve_method_refactor.png]]&lt;br /&gt;
&lt;br /&gt;
First, we moved everything in the approve method from suggestion_controller having to do with a sign up topic to its own new method in sign_up_topic.rb now called new_topic_from_assignment. In doing so, we also delete the entire approve method from suggestion_controller, since refactoring for that method happens concurrently as a result of another issue in this project. &lt;br /&gt;
&lt;br /&gt;
'''''Issue''':There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.''&lt;br /&gt;
&lt;br /&gt;
[[File:Approve suggestion method refactor.png]]&lt;br /&gt;
&lt;br /&gt;
Here, we changed the name of &amp;quot;approve_suggestion&amp;quot; to &amp;quot;approve_suggestion_and_notify&amp;quot;, since it really seems like this method is both to handle approving a suggestion as well as calling the notification method from elsewhere in the controller class. We also add in the first part of the original &amp;quot;approve&amp;quot; method here, so that we can set the instance variables that suggestion_controller might need (@user_id, @team_id, and @topic_id) as well as calling our newly created new_topic_from_suggestion method in SignUpTopic with the proper suggestion passed as a parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the '''send_email''' method to the '''Mailer''' class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to the '''Mailer.rb''' file which seems to have many built-in functionalities for mail services.&lt;br /&gt;
&lt;br /&gt;
[[File:Image_2020-10-13_223533.png]]&lt;br /&gt;
&lt;br /&gt;
Next, the required variables for this method were passed as parameters from '''suggestion_controller''' and is called as a method of Mailer class&lt;br /&gt;
&lt;br /&gt;
[[File:Image 2020-10-13 223357.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Merge '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''' into one view.&lt;br /&gt;
&lt;br /&gt;
Migrate code from student_view.html.erb to show.html.erb and wrap in an if statement that will display view only if user is a student.&lt;br /&gt;
&lt;br /&gt;
[[File:Merge view.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Below test cases were added/updated to ensure the correctness of our work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ADD TEST CASE LOGIC&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135153</id>
		<title>CSC/ECE 517 Fall 2020 - E2069. refactor suggestions controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135153"/>
		<updated>2020-10-14T03:41:29Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: Added in Dylan's two &amp;quot;approve&amp;quot; related issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
The '''suggestions_controller.rb''' of Expertiza is involved in creating/editing suggestions topic suggestions for a project and involved approvals. Students can submit suggestions and work on them if approved. &lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
We intend to improve the readability and code quality of the suggestions_controller.rb. Since this controller has methods that must actually be done by other classes (owing to Single Responsibility feature of the SOLID principles), we have realized the need to move these methods to their respective classes.&lt;br /&gt;
&lt;br /&gt;
== Issues to Fix ==&lt;br /&gt;
1. Move the method '''create_new_team''' (on line 94) to a more appropriate class.&lt;br /&gt;
(Ex: '''Team.rb''' or '''AssignmentTeam.rb''')&lt;br /&gt;
&lt;br /&gt;
2. Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.&lt;br /&gt;
&lt;br /&gt;
3. There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.&lt;br /&gt;
&lt;br /&gt;
4. Move the '''send_email''' method to the '''Mailer''' class in '''app/mailers/mailer.rb'''.&lt;br /&gt;
&lt;br /&gt;
5. In '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''', there seems to be a DRY violation which needs to be fixed. Merge both files into a single view file in order to fix the DRY problem.&lt;br /&gt;
&lt;br /&gt;
== Code Review ==&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''create_new_team''' to a more appropriate class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to '''teams_controller.rb''' since it is appropriate.&lt;br /&gt;
&lt;br /&gt;
[[File:Image 2020-10-13 223836.png]]&lt;br /&gt;
&lt;br /&gt;
We pass the required variables inside the scope of this function as method parameters.&lt;br /&gt;
Then we call the new method as a method of the Team class.&lt;br /&gt;
&lt;br /&gt;
[[File:Image_2020-10-13_224304.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SignUpTopic_approve_method_refactor.png]]&lt;br /&gt;
&lt;br /&gt;
First, we moved everything in the approve method from suggestion_controller having to do with a sign up topic to its own new method in sign_up_topic.rb now called new_topic_from_assignment. In doing so, we also delete the entire approve method from suggestion_controller, since refactoring for that method happens concurrently as a result of another issue in this project. &lt;br /&gt;
&lt;br /&gt;
'''''Issue''':There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.''&lt;br /&gt;
&lt;br /&gt;
[[File:Approve suggestion method refactor.png]]&lt;br /&gt;
&lt;br /&gt;
Here, we changed the name of &amp;quot;approve_suggestion&amp;quot; to &amp;quot;approve_suggestion_and_notify&amp;quot;, since it really seems like this method is both to handle approving a suggestion as well as calling the notification method from elsewhere in the controller class. We also add in the first part of the original &amp;quot;approve&amp;quot; method here, so that we can set the instance variables that suggestion_controller might need (@user_id, @team_id, and @topic_id) as well as calling our newly created new_topic_from_suggestion method in SignUpTopic with the proper suggestion passed as a parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the '''send_email''' method to the '''Mailer''' class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to the '''Mailer.rb''' file which seems to have many built-in functionalities for mail services.&lt;br /&gt;
&lt;br /&gt;
[[File:Image_2020-10-13_223533.png]]&lt;br /&gt;
&lt;br /&gt;
Next, the required variables for this method were passed as parameters from '''suggestion_controller''' and is called as a method of Mailer class&lt;br /&gt;
&lt;br /&gt;
[[File:Image 2020-10-13 223357.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ADD ISSUE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ADD ISSUE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Merge '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''' into one view.&lt;br /&gt;
&lt;br /&gt;
Migrate code from student_view.html.erb to show.html.erb and wrap in an if statement that will display view only if user is a student.&lt;br /&gt;
&lt;br /&gt;
[[File:Merge view.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Below test cases were added/updated to ensure the correctness of our work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ADD TEST CASE LOGIC&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Approve_suggestion_method_refactor.png&amp;diff=135151</id>
		<title>File:Approve suggestion method refactor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Approve_suggestion_method_refactor.png&amp;diff=135151"/>
		<updated>2020-10-14T03:39:27Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135150</id>
		<title>CSC/ECE 517 Fall 2020 - E2069. refactor suggestions controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2020_-_E2069._refactor_suggestions_controller&amp;diff=135150"/>
		<updated>2020-10-14T03:38:55Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: Added in Dylan's two &amp;quot;approve&amp;quot; related issues&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
The '''suggestions_controller.rb''' of Expertiza is involved in creating/editing suggestions topic suggestions for a project and involved approvals. Students can submit suggestions and work on them if approved. &lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
We intend to improve the readability and code quality of the suggestions_controller.rb. Since this controller has methods that must actually be done by other classes (owing to Single Responsibility feature of the SOLID principles), we have realized the need to move these methods to their respective classes.&lt;br /&gt;
&lt;br /&gt;
== Issues to Fix ==&lt;br /&gt;
1. Move the method '''create_new_team''' (on line 94) to a more appropriate class.&lt;br /&gt;
(Ex: '''Team.rb''' or '''AssignmentTeam.rb''')&lt;br /&gt;
&lt;br /&gt;
2. Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.&lt;br /&gt;
&lt;br /&gt;
3. There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.&lt;br /&gt;
&lt;br /&gt;
4. Move the '''send_email''' method to the '''Mailer''' class in '''app/mailers/mailer.rb'''.&lt;br /&gt;
&lt;br /&gt;
5. In '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''', there seems to be a DRY violation which needs to be fixed. Merge both files into a single view file in order to fix the DRY problem.&lt;br /&gt;
&lt;br /&gt;
== Code Review ==&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''create_new_team''' to a more appropriate class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to '''teams_controller.rb''' since it is appropriate.&lt;br /&gt;
&lt;br /&gt;
[[File:Image 2020-10-13 223836.png]]&lt;br /&gt;
&lt;br /&gt;
We pass the required variables inside the scope of this function as method parameters.&lt;br /&gt;
Then we call the new method as a method of the Team class.&lt;br /&gt;
&lt;br /&gt;
[[File:Image_2020-10-13_224304.png]]&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the method '''approve''' to '''SignupTopic.rb''', since it is modifying fields belonging to '''SignupTopic''' directly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SignUpTopic_approve_method_refactor.png]]&lt;br /&gt;
&lt;br /&gt;
First, we moved everything in the approve method from suggestion_controller having to do with a sign up topic to its own new method in sign_up_topic.rb now called new_topic_from_assignment. In doing so, we also delete the entire approve method from suggestion_controller, since refactoring for that method happens concurrently as a result of another issue in this project. &lt;br /&gt;
&lt;br /&gt;
'''''Issue''':There are two methods named similarly: '''approve''' and '''approve_suggestion'''. Their functionality is not clear at first glance. Rename them so that they more accurately reflect their purpose. Add appropriate comments.''&lt;br /&gt;
&lt;br /&gt;
[[File:Screenshot (34)]]&lt;br /&gt;
&lt;br /&gt;
Here, we changed the name of &amp;quot;approve_suggestion&amp;quot; to &amp;quot;approve_suggestion_and_notify&amp;quot;, since it really seems like this method is both to handle approving a suggestion as well as calling the notification method from elsewhere in the controller class. We also add in the first part of the original &amp;quot;approve&amp;quot; method here, so that we can set the instance variables that suggestion_controller might need (@user_id, @team_id, and @topic_id) as well as calling our newly created new_topic_from_suggestion method in SignUpTopic with the proper suggestion passed as a parameter. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Move the '''send_email''' method to the '''Mailer''' class.''&lt;br /&gt;
&lt;br /&gt;
This method was moved to the '''Mailer.rb''' file which seems to have many built-in functionalities for mail services.&lt;br /&gt;
&lt;br /&gt;
[[File:Image_2020-10-13_223533.png]]&lt;br /&gt;
&lt;br /&gt;
Next, the required variables for this method were passed as parameters from '''suggestion_controller''' and is called as a method of Mailer class&lt;br /&gt;
&lt;br /&gt;
[[File:Image 2020-10-13 223357.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ADD ISSUE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ADD ISSUE&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''''Issue''': Merge '''views/suggestion/show.html.erb''' and '''views/suggestion/student_view.html.erb''' into one view.&lt;br /&gt;
&lt;br /&gt;
Migrate code from student_view.html.erb to show.html.erb and wrap in an if statement that will display view only if user is a student.&lt;br /&gt;
&lt;br /&gt;
== Test Cases ==&lt;br /&gt;
&lt;br /&gt;
Below test cases were added/updated to ensure the correctness of our work.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;ADD TEST CASE LOGIC&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:SignUpTopic_approve_method_refactor.png&amp;diff=135149</id>
		<title>File:SignUpTopic approve method refactor.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:SignUpTopic_approve_method_refactor.png&amp;diff=135149"/>
		<updated>2020-10-14T03:37:04Z</updated>

		<summary type="html">&lt;p&gt;Dtjordan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dtjordan</name></author>
	</entry>
</feed>