Spec review

## Overall

## Ruby

Initially I could not get your test suite to run. I deleted some attributes from a factory and marked failing specs as pending.

Using [flog](http://sadi.st/Flog.html) I determined that your three most complex methods are:

##### 52.1: EvidencesController#create       app/controllers/evidences_controller.rb:7

Nothing fails if I comment out the create action in the Evidences controller. Additionally, your Evidences controller spec is empty. Use Rspec Rails controller tests to post to a create action with params.

Your happy path is when `params[:case_id] == ""`. I am not sure what this empty string means… What if params[:case_id] isn't there? I prefer the [`blank?` rails method](http://api.rubyonrails.org/classes/Object.html#method-i-blank-3F). Regardless of happy or sad path you redirect, so there's no real expectation to be had there…

This conditional seems to be related to `CasesUser.where(user_id: session[:id]).where(case_id: params[:case_id]).first.id` which I would rephrase as `CasesUser.where(case_id: params[:case_id], user_id: session[:id])).first.id`.

Get this under test, and then refactor this code so only whatever this conditional is actually doing is inside this if… else.

##### 43.5: BallotsController#create         app/controllers/ballots_controller.rb:3

Nothing fails if I comment out the create action in the Ballots controller. Additionally, your Ballots controller spec is nonexistent. 

The logic in this controller smells like it is model or database level. The params[:role] expects either defendant or plaintiff, and based off of that runs a line like `user_id = Case.find(params[:case_id]).users[0].id`. The case's users is an array? Why not model the relationships here as a case plaintiff or defendant? Then your case is not order dependant, and it will be easier to add different roles for a user in the future. I think that users and cases are joined through roles, and the role relationship can have a type on it. Then you can write a scope on the case model which captures the database specific logic as business logic and not have that crufting its way into the controller.

##### 27.2: PagesController#dashboard        app/controllers/pages_controller.rb:11

This action is also not under test.

This creates two or five instance variables based on whether there is a signed in user. Sandi Metz recommends you only create [one instance variable per controller](http://robots.thoughtbot.com/sandi-metz-rules-for-developers). I think this object is a `@dashboard` which could have more information if there is a signed in user. Try creating a dashboard model and extracting these variables into methods. Then test those methods with unit tests.

_To flog your code run: `find app -name \*.rb | xargs flog` from the root of your directory. (I've aliased this to flog-app on my machine.)_

## JavaScript

There isn't any JavaScript to test, but there are a bunch of empty js files from running generators. Don't commit meaningless generated code.