<?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=Sdalal2</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=Sdalal2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sdalal2"/>
	<updated>2026-08-10T21:09:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2506._Merging_UI_for_View_Assignments_in_Courses&amp;diff=165531</id>
		<title>CSC/ECE 517 Spring 2025 - E2506. Merging UI for View Assignments in Courses</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2506._Merging_UI_for_View_Assignments_in_Courses&amp;diff=165531"/>
		<updated>2025-04-29T13:25:39Z</updated>

		<summary type="html">&lt;p&gt;Sdalal2: /* Manual Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is software that uses Ruby on Rails to manage a website for managing assignments, teams, submissions, and reviews. This web application is managed by students and faculty at NC State, offering instructors full control over class assignments. Expertiza supports a variety of functions, including topic creation, group assignments, and peer review, making it a robust tool for handling diverse types of assignments. For a complete overview of Expertiza's capabilities, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The current course management interface in Expertiza lacks seamless integration between its frontend and backend components. While a new React-based UI and backend implementation have been proposed via pull requests, it is essential to ensure that they function cohesively and reliably when connected. Additionally, there exists a standalone UI for viewing assignments under courses, which is not yet integrated into the main course management interface.&lt;br /&gt;
&lt;br /&gt;
This project addresses two key issues:&lt;br /&gt;
* '''Integration Validation:''' Verifying that the frontend and backend communicate correctly, and that all course-related operations work as expected with proper role-based access control.&lt;br /&gt;
* '''UI Merging:''' Integrating the “View Assignments in Courses” page into the existing React course management UI to provide a unified and intuitive experience for users.&lt;br /&gt;
&lt;br /&gt;
By resolving these issues, the project aims to improve system usability, reduce UI fragmentation, and ensure robust backend interaction through proper testing and integration.&lt;br /&gt;
&lt;br /&gt;
== Purpose and Scope ==&lt;br /&gt;
This project is designed to enhance the reliability, usability, and maintainability of the course management interface in Expertiza by addressing integration inconsistencies and UI separation. The scope is limited to validating and merging the frontend-backend integration for course-related views and actions.&lt;br /&gt;
&lt;br /&gt;
===  Objectives ===&lt;br /&gt;
* '''Validate Integration:''' Ensure the frontend and backend components in the pull request work correctly, including API communications, role-based access, and state updates.&lt;br /&gt;
* '''UI Consolidation:''' Merge the separate “View Assignments in Courses” UI into the main course management React interface.&lt;br /&gt;
* '''Codebase Cleanup:''' Remove redundant or standalone implementations once merged to avoid duplication.&lt;br /&gt;
* '''Maintain Compatibility:''' Ensure that permissions, routing, and rendering work consistently across all merged components.&lt;br /&gt;
* '''Improve UX:''' Provide a cohesive user experience by unifying related course features into a single interface.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
The design goals for this project focus on improving system integrity, performance, maintainability, and clarity in handling course-related operations.&lt;br /&gt;
&lt;br /&gt;
* '''Efficient Data Handling:'''  &lt;br /&gt;
CRUD operations are optimized for handling large datasets, using efficient database queries and pagination where necessary. This ensures that courses and assignments load quickly and scale well with increasing data size.&lt;br /&gt;
&lt;br /&gt;
* '''Error Handling and Validation:'''  &lt;br /&gt;
All inputs are validated on both frontend and backend. The backend returns standardized error responses with helpful messages, ensuring robustness and better feedback during failures or invalid operations.&lt;br /&gt;
&lt;br /&gt;
* '''API Documentation and Testing:'''  &lt;br /&gt;
RSwag is used to generate interactive Swagger API documentation for all CRUD endpoints. This improves testing, encourages adoption, and simplifies integration for future developers.&lt;br /&gt;
&lt;br /&gt;
* '''Modular and Scalable Architecture:'''  &lt;br /&gt;
The backend follows modular design principles such as:&lt;br /&gt;
* Single Responsibility Principle (SRP)  &lt;br /&gt;
* Don’t Repeat Yourself (DRY)  &lt;br /&gt;
Code is organized into manageable units like service objects, controllers, and serializers, making the application easy to maintain and extend.&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
This project is structured into two main parts. As implementation has not yet started, the following outlines our proposed approach to accomplish both tasks.&lt;br /&gt;
&lt;br /&gt;
=== Frontend Implementation ===&lt;br /&gt;
Set up the reimplementation frontend locally from the repository.&lt;br /&gt;
&lt;br /&gt;
* Test the existing course UI to ensure data is rendered from the backend&lt;br /&gt;
* Verify table functionalities like sorting, filtering, pagination, and responsiveness&lt;br /&gt;
* Integrate the “View Assignments in Courses” UI into the course view&lt;br /&gt;
* Add toggle button or collapsible UI element to show/hide assignments&lt;br /&gt;
* Implement dark/light mode toggle using React state and conditional TailwindCSS classes&lt;br /&gt;
* Ensure proper UI formatting for assignment rows, including icons and action handlers&lt;br /&gt;
* Test user interactions and error/success messages&lt;br /&gt;
&lt;br /&gt;
=== UI Screenshots ===&lt;br /&gt;
&lt;br /&gt;
[[File:SS-1.jpg|800px|center|Screenshot of Manage Assignments page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SS-3.jpg|800px|center|Dark mode screenshot of Manage Courses page]]&lt;br /&gt;
&lt;br /&gt;
=== Backend Implementation ===&lt;br /&gt;
Set up the reimplementation backend API locally and link it with the frontend.&lt;br /&gt;
&lt;br /&gt;
* Validate all course-related API endpoints (GET, POST, PUT, DELETE)&lt;br /&gt;
* Ensure assignments returned by the backend are filtered by course ID&lt;br /&gt;
* Monitor backend logs for errors and fix request/response mismatches&lt;br /&gt;
* Confirm compatibility of existing assignment APIs with frontend integration&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Backend Files Changed ===&lt;br /&gt;
&lt;br /&gt;
* database.yml&lt;br /&gt;
* routes.rb&lt;br /&gt;
* docker-compose.yml&lt;br /&gt;
* Participants Controller&lt;br /&gt;
* Assignments Controller&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Frontend Files Changed ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* src/pages/Assignments/Assignment.tsx&lt;br /&gt;
* src/pages/Participants/Participants.tsx&lt;br /&gt;
* src/App.tsx&lt;br /&gt;
&lt;br /&gt;
==Test Plan ==&lt;br /&gt;
&lt;br /&gt;
===  Manual Tests ===&lt;br /&gt;
This project will include manual testing to ensure both frontend-backend integration and UI correctness after merging the &amp;quot;View Assignments in Courses&amp;quot; feature into the course management UI.&lt;br /&gt;
&lt;br /&gt;
'''Frontend/Backend Integration Tests'''&lt;br /&gt;
&lt;br /&gt;
* Ensure the Courses table (Course.tsx) loads all available course records using backend data.&lt;br /&gt;
* Verify that assignment lists (CourseAssignments.tsx) expand correctly under each course and fetch backend data as expected.&lt;br /&gt;
* Validate that create, edit, delete, and copy operations on courses function correctly and reflect real-time updates.&lt;br /&gt;
*Confirm that assignment data is rendered only within its associated course section.&lt;br /&gt;
*Simulate API failure by mocking bad responses and verify that appropriate error messages are shown&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''UI Tests'''&lt;br /&gt;
* Confirm correct icons are used for actions in the Courses and Assignments sections.&lt;br /&gt;
* Ensure the assignment table layout is consistent with the rest of the application (font, spacing, alignment).&lt;br /&gt;
* Validate that the expand/collapse toggle for assignments works smoothly beneath each course row.&lt;br /&gt;
* Check layout behavior across multiple screen sizes, especially in responsive or paginated views.&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
* '''Frontend:''' We will include unit tests using `CourseAssignments.test.tsx` to validate the rendering and behavior of the assignments table.&lt;br /&gt;
* '''Backend:''' API endpoints for courses and assignments will be validated using RSpec controller tests (to be added as implementation progresses).&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' Mitesh Anil Agarwal [mailto:magarwa3@ncsu.edu magarwa3@ncsu.edu]&lt;br /&gt;
&lt;br /&gt;
'''Team Members:'''&lt;br /&gt;
* Yuvraj Singh Bhatia [mailto:ybhatia2@ncsu.edu ybhatia2@ncsu.edu]&lt;br /&gt;
* Sanjana Dalal [mailto:sdalal2@ncsu.edu sdalal2@ncsu.edu]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
*https://github.com/expertiza/reimplementation-front-end/pull/102&lt;br /&gt;
*https://github.com/expertiza/reimplementation-back-end/pull/203&lt;br /&gt;
*https://github.com/expertiza/reimplementation-front-end/pull/70  &lt;br /&gt;
*https://github.com/expertiza/reimplementation-front-end/pull/76  &lt;br /&gt;
*https://github.com/expertiza/reimplementation-front-end  &lt;br /&gt;
*https://github.com/expertiza/reimplementation-back-end&lt;/div&gt;</summary>
		<author><name>Sdalal2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2506._Merging_UI_for_View_Assignments_in_Courses&amp;diff=165526</id>
		<title>CSC/ECE 517 Spring 2025 - E2506. Merging UI for View Assignments in Courses</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2506._Merging_UI_for_View_Assignments_in_Courses&amp;diff=165526"/>
		<updated>2025-04-29T13:22:28Z</updated>

		<summary type="html">&lt;p&gt;Sdalal2: /* Files That May Be Modified */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Background ==&lt;br /&gt;
&lt;br /&gt;
Expertiza is software that uses Ruby on Rails to manage a website for managing assignments, teams, submissions, and reviews. This web application is managed by students and faculty at NC State, offering instructors full control over class assignments. Expertiza supports a variety of functions, including topic creation, group assignments, and peer review, making it a robust tool for handling diverse types of assignments. For a complete overview of Expertiza's capabilities, visit the Expertiza wiki.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;br /&gt;
The current course management interface in Expertiza lacks seamless integration between its frontend and backend components. While a new React-based UI and backend implementation have been proposed via pull requests, it is essential to ensure that they function cohesively and reliably when connected. Additionally, there exists a standalone UI for viewing assignments under courses, which is not yet integrated into the main course management interface.&lt;br /&gt;
&lt;br /&gt;
This project addresses two key issues:&lt;br /&gt;
* '''Integration Validation:''' Verifying that the frontend and backend communicate correctly, and that all course-related operations work as expected with proper role-based access control.&lt;br /&gt;
* '''UI Merging:''' Integrating the “View Assignments in Courses” page into the existing React course management UI to provide a unified and intuitive experience for users.&lt;br /&gt;
&lt;br /&gt;
By resolving these issues, the project aims to improve system usability, reduce UI fragmentation, and ensure robust backend interaction through proper testing and integration.&lt;br /&gt;
&lt;br /&gt;
== Purpose and Scope ==&lt;br /&gt;
This project is designed to enhance the reliability, usability, and maintainability of the course management interface in Expertiza by addressing integration inconsistencies and UI separation. The scope is limited to validating and merging the frontend-backend integration for course-related views and actions.&lt;br /&gt;
&lt;br /&gt;
===  Objectives ===&lt;br /&gt;
* '''Validate Integration:''' Ensure the frontend and backend components in the pull request work correctly, including API communications, role-based access, and state updates.&lt;br /&gt;
* '''UI Consolidation:''' Merge the separate “View Assignments in Courses” UI into the main course management React interface.&lt;br /&gt;
* '''Codebase Cleanup:''' Remove redundant or standalone implementations once merged to avoid duplication.&lt;br /&gt;
* '''Maintain Compatibility:''' Ensure that permissions, routing, and rendering work consistently across all merged components.&lt;br /&gt;
* '''Improve UX:''' Provide a cohesive user experience by unifying related course features into a single interface.&lt;br /&gt;
&lt;br /&gt;
== Design Goals ==&lt;br /&gt;
&lt;br /&gt;
The design goals for this project focus on improving system integrity, performance, maintainability, and clarity in handling course-related operations.&lt;br /&gt;
&lt;br /&gt;
* '''Efficient Data Handling:'''  &lt;br /&gt;
CRUD operations are optimized for handling large datasets, using efficient database queries and pagination where necessary. This ensures that courses and assignments load quickly and scale well with increasing data size.&lt;br /&gt;
&lt;br /&gt;
* '''Error Handling and Validation:'''  &lt;br /&gt;
All inputs are validated on both frontend and backend. The backend returns standardized error responses with helpful messages, ensuring robustness and better feedback during failures or invalid operations.&lt;br /&gt;
&lt;br /&gt;
* '''API Documentation and Testing:'''  &lt;br /&gt;
RSwag is used to generate interactive Swagger API documentation for all CRUD endpoints. This improves testing, encourages adoption, and simplifies integration for future developers.&lt;br /&gt;
&lt;br /&gt;
* '''Modular and Scalable Architecture:'''  &lt;br /&gt;
The backend follows modular design principles such as:&lt;br /&gt;
* Single Responsibility Principle (SRP)  &lt;br /&gt;
* Don’t Repeat Yourself (DRY)  &lt;br /&gt;
Code is organized into manageable units like service objects, controllers, and serializers, making the application easy to maintain and extend.&lt;br /&gt;
&lt;br /&gt;
== Implementation Plan ==&lt;br /&gt;
This project is structured into two main parts. As implementation has not yet started, the following outlines our proposed approach to accomplish both tasks.&lt;br /&gt;
&lt;br /&gt;
=== Frontend Implementation ===&lt;br /&gt;
Set up the reimplementation frontend locally from the repository.&lt;br /&gt;
&lt;br /&gt;
* Test the existing course UI to ensure data is rendered from the backend&lt;br /&gt;
* Verify table functionalities like sorting, filtering, pagination, and responsiveness&lt;br /&gt;
* Integrate the “View Assignments in Courses” UI into the course view&lt;br /&gt;
* Add toggle button or collapsible UI element to show/hide assignments&lt;br /&gt;
* Implement dark/light mode toggle using React state and conditional TailwindCSS classes&lt;br /&gt;
* Ensure proper UI formatting for assignment rows, including icons and action handlers&lt;br /&gt;
* Test user interactions and error/success messages&lt;br /&gt;
&lt;br /&gt;
=== UI Screenshots ===&lt;br /&gt;
&lt;br /&gt;
[[File:SS-1.jpg|800px|center|Screenshot of Manage Assignments page]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SS-3.jpg|800px|center|Dark mode screenshot of Manage Courses page]]&lt;br /&gt;
&lt;br /&gt;
=== Backend Implementation ===&lt;br /&gt;
Set up the reimplementation backend API locally and link it with the frontend.&lt;br /&gt;
&lt;br /&gt;
* Validate all course-related API endpoints (GET, POST, PUT, DELETE)&lt;br /&gt;
* Ensure assignments returned by the backend are filtered by course ID&lt;br /&gt;
* Monitor backend logs for errors and fix request/response mismatches&lt;br /&gt;
* Confirm compatibility of existing assignment APIs with frontend integration&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
&lt;br /&gt;
=== Part 1: Backend Files Changed ===&lt;br /&gt;
&lt;br /&gt;
* database.yml&lt;br /&gt;
* routes.rb&lt;br /&gt;
* docker-compose.yml&lt;br /&gt;
* Participants Controller&lt;br /&gt;
* Assignments Controller&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Part 2: Frontend Files CHanged ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* src/pages/Assignments/Assignment.tsx&lt;br /&gt;
* src/pages/Participants/Participants.tsx&lt;br /&gt;
* src/App.tsx&lt;br /&gt;
&lt;br /&gt;
==Test Plan ==&lt;br /&gt;
&lt;br /&gt;
===  Manual Tests ===&lt;br /&gt;
This project will include manual testing to ensure both frontend-backend integration and UI correctness after merging the &amp;quot;View Assignments in Courses&amp;quot; feature into the course management UI.&lt;br /&gt;
&lt;br /&gt;
'''Frontend/Backend Integration Tests'''&lt;br /&gt;
* Ensure the Courses table loads all available course records using backend data.&lt;br /&gt;
* Verify that assignment lists expand correctly under each course.&lt;br /&gt;
* Validate that create, edit, delete, and copy operations on courses function correctly and reflect real-time updates.&lt;br /&gt;
* Confirm that assignment data is fetched and rendered within the appropriate course context.&lt;br /&gt;
* Simulate API failure or incorrect responses and verify appropriate error messages are displayed.&lt;br /&gt;
&lt;br /&gt;
'''UI Tests'''&lt;br /&gt;
* Confirm that the correct action icons are used for editing, deleting, and copying courses and assignments.&lt;br /&gt;
* Ensure the assignment table layout matches the rest of the application in font size, spacing, and alignment.&lt;br /&gt;
* Validate that assignment rows expand/collapse smoothly beneath their corresponding courses.&lt;br /&gt;
* Check pagination behavior and confirm usability across all screen sizes (desktop and mobile).&lt;br /&gt;
* Test dark/light mode toggle to ensure it switches the UI theme without breaking layout or styles.&lt;br /&gt;
&lt;br /&gt;
=== Automated Tests ===&lt;br /&gt;
* '''Frontend:''' We will include unit tests using `CourseAssignments.test.tsx` to validate the rendering and behavior of the assignments table.&lt;br /&gt;
* '''Backend:''' API endpoints for courses and assignments will be validated using RSpec controller tests (to be added as implementation progresses).&lt;br /&gt;
&lt;br /&gt;
== Team ==&lt;br /&gt;
'''Mentor:''' Mitesh Anil Agarwal [mailto:magarwa3@ncsu.edu magarwa3@ncsu.edu]&lt;br /&gt;
&lt;br /&gt;
'''Team Members:'''&lt;br /&gt;
* Yuvraj Singh Bhatia [mailto:ybhatia2@ncsu.edu ybhatia2@ncsu.edu]&lt;br /&gt;
* Sanjana Dalal [mailto:sdalal2@ncsu.edu sdalal2@ncsu.edu]&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
&lt;br /&gt;
*https://github.com/expertiza/reimplementation-front-end/pull/70  &lt;br /&gt;
*https://github.com/expertiza/reimplementation-front-end/pull/76  &lt;br /&gt;
*https://github.com/expertiza/reimplementation-front-end  &lt;br /&gt;
*https://github.com/expertiza/reimplementation-back-end&lt;/div&gt;</summary>
		<author><name>Sdalal2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Frontend.png&amp;diff=165515</id>
		<title>File:Frontend.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Frontend.png&amp;diff=165515"/>
		<updated>2025-04-29T13:04:59Z</updated>

		<summary type="html">&lt;p&gt;Sdalal2: Sdalal2 uploaded a new version of File:Frontend.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Sdalal2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2506._Implement_testing_for_new_Bookmarks_Controller&amp;diff=162833</id>
		<title>CSC/ECE 517 Spring 2025 - E2506. Implement testing for new Bookmarks Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2506._Implement_testing_for_new_Bookmarks_Controller&amp;diff=162833"/>
		<updated>2025-03-25T04:33:00Z</updated>

		<summary type="html">&lt;p&gt;Sdalal2: /* E2516: Reimplement teams_users_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E2516: Reimplement testing for new Bookmarks Controller==&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open-source Ruby on Rails application designed to help teachers manage classrooms. It is maintained by the teaching staff at NC State, along with the students who use it. The application includes various models, such as assignments, questions, and users. Expertiza, students can organize into different teams to work on different assignments and projects. Also, students have the capability to peer review as a way for students to evaluate each other's work. Expertiza allows submissions from a variety of document types, such as PDFs, wiki pages and URLs.&lt;br /&gt;
&lt;br /&gt;
===Project Overview===&lt;br /&gt;
This project focuses on enhancing the BookmarksController in the Expertiza platform by adding comprehensive test coverage, generating API documentation, and improving code quality and maintainability. The main objectives are to:&lt;br /&gt;
&lt;br /&gt;
* Develop Tests: Achieve at least 90% test coverage for CRUD operations, bookmark ratings, and score calculations, ensuring edge cases and error handling are properly validated.&lt;br /&gt;
* Generate API Documentation: Use Swagger UI to create clear and accurate API documentation for the BookmarksController.&lt;br /&gt;
* Refactor Code: Optimize the code using Rubocop and Code Climate, remove unused functionality, and clarify ambiguous methods to improve maintainability and performance.&lt;br /&gt;
* Authorization &amp;amp; Error Handling: Ensure proper authorization rules are enforced, and handle errors with informative messages.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
The following files have been modified to achieve the mentioned functionalities:&lt;br /&gt;
* Role_test.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===role_test.rb===&lt;br /&gt;
The changes made were:&lt;br /&gt;
&lt;br /&gt;
* Test 1: test_bookmark_creation_validity&lt;br /&gt;
This test case verifies the validity of a bookmark creation process. It checks that a bookmark is successfully created when valid parameters are provided, ensuring the bookmark is saved to the database. Additionally, it validates that the bookmark creation fails if essential attributes (e.g., title or URL) are missing, returning the appropriate error message to guide the user.&lt;br /&gt;
* Test 2: test_bookmark_rating&lt;br /&gt;
This test case ensures the correct functionality of the bookmark rating feature. It verifies that a bookmark can receive a rating, and that the average rating is updated correctly when a user rates it. Additionally, it checks that the system properly handles invalid ratings, such as out-of-range values or duplicate ratings from the same user.&lt;br /&gt;
* Test 3: test_bookmark_deletion&lt;br /&gt;
This test case tests the functionality of bookmark deletion. It ensures that a bookmark can be successfully deleted when a user requests it, and that it is no longer present in the database afterward. Additionally, it checks that attempting to delete a non-existent bookmark returns the appropriate error message.&lt;br /&gt;
&lt;br /&gt;
  test 'validates name length' do&lt;br /&gt;
    role = Role.new(name: 'A' * 51) # assuming max length is 50&lt;br /&gt;
    assert_not role.valid?&lt;br /&gt;
    assert_equal ['is too long (maximum is 50 characters)'], role.errors[:name]&lt;br /&gt;
    role.name = 'A' * 2 # assuming min length is 3&lt;br /&gt;
    assert_not role.valid?&lt;br /&gt;
    assert_equal ['is too short (minimum is 3 characters)'], role.errors[:name]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Test for role parent-child relationships&lt;br /&gt;
  test 'parent-child relationship' do&lt;br /&gt;
    parent_role = Role.create!(name: 'Parent Role')&lt;br /&gt;
    child_role = Role.create!(name: 'Child Role', parent: parent_role)&lt;br /&gt;
    assert_equal parent_role, child_role.parent&lt;br /&gt;
    assert_includes parent_role.subordinate_roles, child_role&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Test for role deletion behavior&lt;br /&gt;
  test 'role deletion cascade' do&lt;br /&gt;
    parent_role = Role.create!(name: 'Parent Role')&lt;br /&gt;
    child_role = Role.create!(name: 'Child Role', parent: parent_role)&lt;br /&gt;
    parent_role.destroy&lt;br /&gt;
    assert_raises(ActiveRecord::RecordNotFound) { child_role.reload }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
* Mitesh Anil Agarawal ([mailto:magarwa3@ncsu.edu magarwa3@ncsu.edu])&lt;br /&gt;
* Kartiki Bhandakkar ([mailto:kbhanda3@ncsu.edu kbhanda3@ncsu.edu])&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
&lt;br /&gt;
* Sanjana Dalal               ([mailto:sdalal2@ncsu.edu sdalal2@ncsu.edu])&lt;br /&gt;
* Yuvraj Singh Bhatia                 ([mailto:ybhatia2@ncsu.edu ybhatia2@ncsu.edu])&lt;/div&gt;</summary>
		<author><name>Sdalal2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2506._Implement_testing_for_new_Bookmarks_Controller&amp;diff=162832</id>
		<title>CSC/ECE 517 Spring 2025 - E2506. Implement testing for new Bookmarks Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2025_-_E2506._Implement_testing_for_new_Bookmarks_Controller&amp;diff=162832"/>
		<updated>2025-03-25T04:32:29Z</updated>

		<summary type="html">&lt;p&gt;Sdalal2: Created page with &amp;quot;==E2516: Reimplement teams_users_controller.rb==  ===Introduction=== Expertiza is an open-source Ruby on Rails application designed to help teachers manage classrooms. It is maintained by the teaching staff at NC State, along with the students who use it. The application includes various models, such as assignments, questions, and users. Expertiza, students can organize into different teams to work on different assignments and projects. Also, students have the capability...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E2516: Reimplement teams_users_controller.rb==&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
Expertiza is an open-source Ruby on Rails application designed to help teachers manage classrooms. It is maintained by the teaching staff at NC State, along with the students who use it. The application includes various models, such as assignments, questions, and users. Expertiza, students can organize into different teams to work on different assignments and projects. Also, students have the capability to peer review as a way for students to evaluate each other's work. Expertiza allows submissions from a variety of document types, such as PDFs, wiki pages and URLs.&lt;br /&gt;
&lt;br /&gt;
===Project Overview===&lt;br /&gt;
This project focuses on enhancing the BookmarksController in the Expertiza platform by adding comprehensive test coverage, generating API documentation, and improving code quality and maintainability. The main objectives are to:&lt;br /&gt;
&lt;br /&gt;
* Develop Tests: Achieve at least 90% test coverage for CRUD operations, bookmark ratings, and score calculations, ensuring edge cases and error handling are properly validated.&lt;br /&gt;
* Generate API Documentation: Use Swagger UI to create clear and accurate API documentation for the BookmarksController.&lt;br /&gt;
* Refactor Code: Optimize the code using Rubocop and Code Climate, remove unused functionality, and clarify ambiguous methods to improve maintainability and performance.&lt;br /&gt;
* Authorization &amp;amp; Error Handling: Ensure proper authorization rules are enforced, and handle errors with informative messages.&lt;br /&gt;
&lt;br /&gt;
===Files Modified===&lt;br /&gt;
The following files have been modified to achieve the mentioned functionalities:&lt;br /&gt;
* Role_test.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===role_test.rb===&lt;br /&gt;
The changes made were:&lt;br /&gt;
&lt;br /&gt;
* Test 1: test_bookmark_creation_validity&lt;br /&gt;
This test case verifies the validity of a bookmark creation process. It checks that a bookmark is successfully created when valid parameters are provided, ensuring the bookmark is saved to the database. Additionally, it validates that the bookmark creation fails if essential attributes (e.g., title or URL) are missing, returning the appropriate error message to guide the user.&lt;br /&gt;
* Test 2: test_bookmark_rating&lt;br /&gt;
This test case ensures the correct functionality of the bookmark rating feature. It verifies that a bookmark can receive a rating, and that the average rating is updated correctly when a user rates it. Additionally, it checks that the system properly handles invalid ratings, such as out-of-range values or duplicate ratings from the same user.&lt;br /&gt;
* Test 3: test_bookmark_deletion&lt;br /&gt;
This test case tests the functionality of bookmark deletion. It ensures that a bookmark can be successfully deleted when a user requests it, and that it is no longer present in the database afterward. Additionally, it checks that attempting to delete a non-existent bookmark returns the appropriate error message.&lt;br /&gt;
&lt;br /&gt;
  test 'validates name length' do&lt;br /&gt;
    role = Role.new(name: 'A' * 51) # assuming max length is 50&lt;br /&gt;
    assert_not role.valid?&lt;br /&gt;
    assert_equal ['is too long (maximum is 50 characters)'], role.errors[:name]&lt;br /&gt;
    role.name = 'A' * 2 # assuming min length is 3&lt;br /&gt;
    assert_not role.valid?&lt;br /&gt;
    assert_equal ['is too short (minimum is 3 characters)'], role.errors[:name]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Test for role parent-child relationships&lt;br /&gt;
  test 'parent-child relationship' do&lt;br /&gt;
    parent_role = Role.create!(name: 'Parent Role')&lt;br /&gt;
    child_role = Role.create!(name: 'Child Role', parent: parent_role)&lt;br /&gt;
    assert_equal parent_role, child_role.parent&lt;br /&gt;
    assert_includes parent_role.subordinate_roles, child_role&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Test for role deletion behavior&lt;br /&gt;
  test 'role deletion cascade' do&lt;br /&gt;
    parent_role = Role.create!(name: 'Parent Role')&lt;br /&gt;
    child_role = Role.create!(name: 'Child Role', parent: parent_role)&lt;br /&gt;
    parent_role.destroy&lt;br /&gt;
    assert_raises(ActiveRecord::RecordNotFound) { child_role.reload }&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
* Mitesh Anil Agarawal ([mailto:magarwa3@ncsu.edu magarwa3@ncsu.edu])&lt;br /&gt;
* Kartiki Bhandakkar ([mailto:kbhanda3@ncsu.edu kbhanda3@ncsu.edu])&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
&lt;br /&gt;
* Sanjana Dalal               ([mailto:sdalal2@ncsu.edu sdalal2@ncsu.edu])&lt;br /&gt;
* Yuvraj Singh Bhatia                 ([mailto:ybhatia2@ncsu.edu ybhatia2@ncsu.edu])&lt;/div&gt;</summary>
		<author><name>Sdalal2</name></author>
	</entry>
</feed>