CSC/CSC 517 Fall 2016/oss E1667

From Expertiza_Wiki
Revision as of 03:01, 29 October 2016 by Iyadav (talk | contribs)
Jump to navigation Jump to search

Template:Student sandbox

About Expertiza

Expertiza is an open source application developed on the Ruby on Rails framework. It allows instructors to create assignments, set deadlines and give grades to the assignments. In this application, students can submit their assignments by providing links to their sites or repositories or upload files and folders. The students can also review assignments submitted by their peers.

Problem Statement

Goal: The aim of the project was to write a feature test that mocks the Heat Map that a student views for an assignment of his. The following tasks were performed to accomplish the goal:

  1. Understanding the flow of the creation of Assignment by instructor.
  2. Understanding the flow of the submission of an assignment by a student and then the flow of submitting reviews to an assignment uploaded by a student.
  3. Understanding the flow of viewing the Heat Map related to an assignment by a student.
  4. Mock the above steps using capybara.

Project Links

Instructions for Reviewer

Clone the reopsitory

     git clone (repository URL)

Repository URL can be found by visiting this Github repo.

Installing Gems (ruby dependencies)

Go to your cloned expertiza directory in terminal and run the following command:

    bundle install

Setting up the databses

  • Run the Expertiza database migrations. This should populate your database with the current tables of the schema.
  rake db:migrate

Running the tests

  • Go to your cloned expertiza directory and run the following command for the tests:
   rspec spec/features/heat_map_spec.rb

Note : Travis CI build fails because we are directly using the development database for our tests, thus Travis CI is not able to locate the login information. This was done because it was not possible to create factories or fixtures for our tests. So, please don’t consider the build failure in the pull request to be a valid error.

Classes Involved

The heat_map_spce.rb contains the feature tests written to test the creation of the assignment. The rails_helper is copied to spec/ when you run 'rails generate rspec:install'. All the rspec-expectations config goes into the spec_helper_file. We have used Capybara and RSpec to test our application. Capybara helps you test web applications by simulating how a real user would interact with your app. One of the major reasons for selecting Capybara to write our tests was that it has an intuitive API which mimics the language an actual user would use and also we can run tests from fast headless mode to an actual browser with no changes to our tests.

Flow of our test

Code

heat_map_spec.rb