No commit activity in last 3 years
No release in over 3 years
Part of the Fluoride suite - tools for making your black box a bit whiter
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

This is the Analyzer part for fluoride: a tool to whiten the black boxes that Rails apps can become.

The idea here is:

  1. Download a set of fluoride exchange .yml files generated by fluoride-collector
  2. Generate a list of routes actually hit in production
  3. Generate a scaffold set of request specs for producing quick test coverage

To set this up in a Rails app:

add

gem 'fluoride-analyzer'

to your Gemfile

bundle install

Create a file at lib/tasks/fluoride.rb with:

require 'fluoride-analyzer/tasklib'

Fluoride::Analyzer::Tasklib.new

Check that it worked: bundle exec rake -T should include fluoride:analyzer:template_request_specs

Make a directory called fluoride/request_recordings and put the fluoride captures there.

Run bundle exec rake fluoride:analyzer:template_request_specs

The result should be a directory 'fluoride/spec/requests' filled with automatically generated request specs.

Now starts the process of moving those specs to your normal spec directory and making them pass. Generally, the specs will fail because they ran against a live app, and the test environment doesn't have e.g. database records that the live app does - you'll need to mock or factory records so that the request specs will pass.