CSC/ECE 517 Spring 2018- Project E1804: OSS project Yellow: Topic management: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 37: Line 37:
::* Testing that if an assignment due date has passed:
::* Testing that if an assignment due date has passed:
::**Topics are no longer editable and you can no longer add/delete topics
::**Topics are no longer editable and you can no longer add/delete topics
===== app/spec/controllers/assignments_controller_spec.rb =====
<pre>


    context 'assignment due dates have not passed' do
      before(:each) do
        due_date.due_at = DateTime.now.in_time_zone + 1.day
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)
      end
      it 'allows a topic to be edited' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).to respond_to(:edit)
      end
      it 'allows a topic to be deleted' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).to respond_to(:destroy)
      end
      it 'allows a new topic to be added' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).to respond_to(:new)
      end
    end
</pre>
::* Testing that if an assignment due date has not passed:
::* Testing that if an assignment due date has not passed:
::**Topics are  editable and you can add/delete topics
::**Topics are  editable and you can add/delete topics
===== app/spec/controllers/assignments_controller_spec.rb =====
<pre>
    context 'all assignment due dates have passed' do
      before(:each) do
        due_date.due_at = DateTime.now.in_time_zone - 1.day
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)
      end
      it 'does not allow a topic to be edited' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).not_to respond_to(:edit)
      end
      it 'does not allow a topic to be deleted' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).not_to respond_to(:destroy)
      end
      it 'does not allow a new topic to be added' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).not_to respond_to(:new)
      end
    end
</pre>
::* Testing that default topic available slots is 1
===== app/spec/controllers/sign_up_sheer_controller_spec.rb =====
<pre>
  define '#new' do
    it 'has default available slots of 1' do
      params = {id: 1}
      get :new, params
      expect(response).to have_field('max_choosers', with: '1')
    end
  end
</pre>


==== '''Further Testing Required''' ====
==== '''Further Testing Required''' ====
::
::Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:
::*If assignment deadline has passed, you can not add students to a topic
::*Ensure students cant see which students are on other topics
::*Check that Advertisement Horn shows in the table if a team has an ad open
::*If you login as student, you can't add/delete topics in the table


== Issue 926 ==
== Issue 926 ==

Revision as of 22:59, 26 March 2018

This page provides a description of the Expertiza project.

Introduction

Expertiza Background

Expertiza is a web-based framework designed in Ruby on Rails to serve as a medium for students and professors to interact, provide feedback, and manage their assignments. It facilitates all of the electronic turn-ins and provides a good place to review your peers' work.

Problem Statement

To enhance topic management for instructors and students.

  • Issue 971: Change create topic UI to AJAX
  • Issue 926: Sort topics by topic number in assignment#edit
  • Issue 718: Allow instructions to give feedback when accepting or rejecting suggestions

Our Goals

We planned to improve the functionality such that when instructors have to manage the topics for an assignment, they can do so much quicker and more reliably.

Files Edited

  • app/spec/controllers/assignments_controller_spec.rb
  • app/spec/controllers/sign_up_sheet_controller_spec.rb

Issue 971

Implementation

Further Implementation Required

Testing

For testing the newly created JSGrid, it is important to ensure it maintains correct functionality from before. To that end, we created quite a few tests that test manage topic functionality.
  • Testing that if an assignment due date has passed:
    • Topics are no longer editable and you can no longer add/delete topics
app/spec/controllers/assignments_controller_spec.rb

    context 'assignment due dates have not passed' do
      before(:each) do
        due_date.due_at = DateTime.now.in_time_zone + 1.day
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)
      end
      it 'allows a topic to be edited' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).to respond_to(:edit)
      end

      it 'allows a topic to be deleted' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).to respond_to(:destroy)
      end

      it 'allows a new topic to be added' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).to respond_to(:new)
      end
    end

  • Testing that if an assignment due date has not passed:
    • Topics are editable and you can add/delete topics
app/spec/controllers/assignments_controller_spec.rb

    context 'all assignment due dates have passed' do
      before(:each) do
        due_date.due_at = DateTime.now.in_time_zone - 1.day
        allow(assignment.due_dates).to receive(:find_by).with(deadline_type_id: 6).and_return(due_date)
      end
      it 'does not allow a topic to be edited' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).not_to respond_to(:edit)
      end

      it 'does not allow a topic to be deleted' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).not_to respond_to(:destroy)
      end

      it 'does not allow a new topic to be added' do
        params = {id: 1, anchor: 'tabs-2'}
        get :edit, params, xhr: true
        expect(response).not_to respond_to(:new)
      end
    end

  • Testing that default topic available slots is 1
app/spec/controllers/sign_up_sheer_controller_spec.rb
  define '#new' do
    it 'has default available slots of 1' do
      params = {id: 1}
      get :new, params
      expect(response).to have_field('max_choosers', with: '1')
    end
  end

Further Testing Required

Unfortunately we were unable to exhaustively test the topic table, but here are the things we plan to test about managing topics over the next week:
  • If assignment deadline has passed, you can not add students to a topic
  • Ensure students cant see which students are on other topics
  • Check that Advertisement Horn shows in the table if a team has an ad open
  • If you login as student, you can't add/delete topics in the table

Issue 926

Implementation

Further Implementation Required

Testing

Further Testing Required

Issue 718

Implementation

Further Implementation Required

Testing

Further Testing Required