CSC/ECE 517 Fall 2021 - E2139. Remove multiple topics at a time: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Created page with "==About Expertiza== Expertiza is a Ruby on Rails based open source project that allows users to submit a variety of document types, including URLs and wiki pages. It allows th...")
 
No edit summary
Line 5: Line 5:


==Project Description==
==Project Description==
Expertiza has Assignment objects, which represent an assignment that is done by a number of users.  For some assignments, students need to select a topic before submitting work. For deleting a topic, there is a checkbox beside each topic that can be selected and then the instructor or TA can delete the selected topics from the assignment. The feature needs to be tested thoroughly for various scenarios where different kinds of flags for the assignment are checked like staggered deadline, private assignment, micro task assignment. Also, we need to test the feature when all topics are deleted, some topics are deleted and only one topic is deleted.


===Team Members===
===Team Members===
Divyang Doshi
Hardik Udeshi
Shlok Sayani
===Files Involved===
===Files Involved===
spec/controllers/sign_up_sheet_controller_spec.rb
===Running test cases===
===Running test cases===
<pre>
run the command :- rspec spec/controllers/sign_up_sheet_controller_spec.rb
</pre>


==Testing scenarios==
==Testing scenarios==
<ol>
<li> When the assignment is a microtask and all other flags are False. </li>
<ol>
<li>Testing deleting all topics for microtask assignment. We test the delete all functionality by creating few topics associated with a microtask assignment and then do a post request on delete_all_selected_topics. We then expect the number of topics related to this assignment should be 0. We also assert that redirect to edit assignment page is successful after deletion of topics.</li>
<pre>
    it 'delete_all_selected_topics for a microtask assignment and redirects to edit assignment page with single topic selected' do
      create(:topic, id: 6000, assignment_id: 6000, topic_identifier: 'topic6000')
      params = {assignment_id: 6000, topic_ids: ['topic6000']}
      post :delete_all_selected_topics, params
      expect(flash[:success]).to eq('All selected topics have been deleted successfully.')
      topics_exist = SignUpTopic.where(assignment_id: 6000).count
      expect(topics_exist).to be_eql 0
      expect(response).to redirect_to('/assignments/6000/edit#tabs-2')
    end
</pre>
<li>Testing deleting multiple topics for microtask assignment. We test the delete multiple functionality by creating few topics associated with a microtask assignment and then do a post request on delete_all_selected_topics. We then expect the number of topics related to this assignment should be number of topics created - number of topics deleted. We also assert that redirect to edit assignment page is successful after deletion of topics.</li>
<pre>
    it 'delete_all_selected_topics for not microtask assignment and redirects to edit assignment page with multiple topic selected' do
      create(:topic, id: 6000, assignment_id: 7000, topic_identifier: 'topic6000')
      create(:topic, id: 7000, assignment_id: 7000, topic_identifier: 'topic7000')
      create(:topic, id: 8000, assignment_id: 7000, topic_identifier: 'topic8000')
      params = {assignment_id: 7000, topic_ids: ['topic6000', 'topic7000']}
      post :delete_all_selected_topics, params
      expect(flash[:success]).to eq('All selected topics have been deleted successfully.')
      topics_exist = SignUpTopic.where(assignment_id: 7000).count
      expect(topics_exist).to be_eql 1
      expect(response).to redirect_to('/assignments/7000/edit#tabs-2')
      params = {assignment_id: 7000, topic_ids: ['topic8000']}
      post :delete_all_selected_topics, params
      expect(flash[:success]).to eq('All selected topics have been deleted successfully.')
      topics_exist = SignUpTopic.where(assignment_id: 7000).count
      expect(topics_exist).to be_eql 0
      expect(response).to redirect_to('/assignments/7000/edit#tabs-2')
    end
</pre>
</ol>


</ol>
==Test Results==
==Test Results==


==Repository Link==
==Repository Link==

Revision as of 07:57, 19 October 2021

About Expertiza

Expertiza is a Ruby on Rails based open source project that allows users to submit a variety of document types, including URLs and wiki pages. It allows the instructor to create and customize new or existing assignments as well as a list of topics for which students can sign up. Expertiza allows students to form groups to work on various projects and assignments. It also allows students to peer review the work of other students.

Project Description

Expertiza has Assignment objects, which represent an assignment that is done by a number of users. For some assignments, students need to select a topic before submitting work. For deleting a topic, there is a checkbox beside each topic that can be selected and then the instructor or TA can delete the selected topics from the assignment. The feature needs to be tested thoroughly for various scenarios where different kinds of flags for the assignment are checked like staggered deadline, private assignment, micro task assignment. Also, we need to test the feature when all topics are deleted, some topics are deleted and only one topic is deleted.

Team Members

Divyang Doshi Hardik Udeshi Shlok Sayani

Files Involved

spec/controllers/sign_up_sheet_controller_spec.rb

Running test cases

run the command :- rspec spec/controllers/sign_up_sheet_controller_spec.rb

Testing scenarios

  1. When the assignment is a microtask and all other flags are False.
    1. Testing deleting all topics for microtask assignment. We test the delete all functionality by creating few topics associated with a microtask assignment and then do a post request on delete_all_selected_topics. We then expect the number of topics related to this assignment should be 0. We also assert that redirect to edit assignment page is successful after deletion of topics.
    2.     it 'delete_all_selected_topics for a microtask assignment and redirects to edit assignment page with single topic selected' do
            create(:topic, id: 6000, assignment_id: 6000, topic_identifier: 'topic6000')
            params = {assignment_id: 6000, topic_ids: ['topic6000']}
            post :delete_all_selected_topics, params
            expect(flash[:success]).to eq('All selected topics have been deleted successfully.')
            topics_exist = SignUpTopic.where(assignment_id: 6000).count
            expect(topics_exist).to be_eql 0
            expect(response).to redirect_to('/assignments/6000/edit#tabs-2')
          end
      
    3. Testing deleting multiple topics for microtask assignment. We test the delete multiple functionality by creating few topics associated with a microtask assignment and then do a post request on delete_all_selected_topics. We then expect the number of topics related to this assignment should be number of topics created - number of topics deleted. We also assert that redirect to edit assignment page is successful after deletion of topics.
    4.     it 'delete_all_selected_topics for not microtask assignment and redirects to edit assignment page with multiple topic selected' do
            create(:topic, id: 6000, assignment_id: 7000, topic_identifier: 'topic6000')
            create(:topic, id: 7000, assignment_id: 7000, topic_identifier: 'topic7000')
            create(:topic, id: 8000, assignment_id: 7000, topic_identifier: 'topic8000')
            params = {assignment_id: 7000, topic_ids: ['topic6000', 'topic7000']}
            post :delete_all_selected_topics, params
            expect(flash[:success]).to eq('All selected topics have been deleted successfully.')
            topics_exist = SignUpTopic.where(assignment_id: 7000).count
            expect(topics_exist).to be_eql 1
            expect(response).to redirect_to('/assignments/7000/edit#tabs-2')
      
            params = {assignment_id: 7000, topic_ids: ['topic8000']}
            post :delete_all_selected_topics, params
            expect(flash[:success]).to eq('All selected topics have been deleted successfully.')
            topics_exist = SignUpTopic.where(assignment_id: 7000).count
            expect(topics_exist).to be_eql 0
            expect(response).to redirect_to('/assignments/7000/edit#tabs-2')
          end
      

Test Results

Repository Link