akshatpradhan/compliance_chimp — pull request #34 by adamico (2014-03-20 13:16:52+00:00)
Title: Requirements progress

This pull request adds a visual cue of requirements compliance for a given user by means of Lazy High Charts. The last commits adds a lot of code and complexity which is needed to avoid using ugly class methods in requirement class which always require a user as arguments. By means of a service class (RequirementSeries, deserves a better class name but I couldn't find better) to which I provide the Requirement class and a user I build the data series of complete/incomplete requirements percentage and labels ("Complete"/"Incomplete") for HighCharts to build the pie chart.
A simple capybara specs checks for the existence of a div having a data attribute created by HighCharts in requirements#index view. I then unit tested Requirement model to ensure the data series where correctly build. I'll add unit tests of the service object instead of a Requirement model spec in the future.