User:Vntpaul1994/sandbox

Introduction
This page provides a description of the Expertiza based OSS project. Expertiza is an open source rails application developed on ruby and rails. The application allows students to submit and peer-review learning objects (articles, code, web sites, etc). The instructors can create assignments using this application and customize and manage them. It also helps to introduce the peer review system by which students can review the projects of their colleagues.

Problem Statement
We were expected to write a feature test which mocks the creation of an Assignment. For Expertiza Assignment management is the central part of the workflow. Goals:
 * 1) Understand the flow of the Assignment creation by instructor manually.
 * 2) Mock the same steps using capybara
 * 3) Create multiple assignments with different options and testing their existence.

Project Links

 * Github repo
 * Expertiza pull request
 * Youtube video manual

Classes Involved

 * assignment_creation.rb
 * spec_helper.rb
 * rails_helper.rb

The assignment_creation.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.

assignment_creation.rb
Given above is a portion of the code written in the assignment_creation.rb. First include the rails_helper and the spec_helper files. After that we write a behavior for our test, which in this case is "creating a private assignment". Now before running each scenario we have to ensure that the instructor is logged in so that each he can create the assignment. This is written in the before(:each) block. After this, we test different scenarios