Softwear::Lib
Installation
Add this line to your application's Gemfile:
gem 'softwear-lib'
And then execute:
$ bundle install
Usage
Database capture
This feature will capture a generous subset of the production (or development) database into a spec. This serves 2 main purposes:
- to quickly convert hand-tested data into a spec without writing complex factories, and
- to isolate and begin testing a faulty set of live data before fully understanding the problem
To run:
bundle exec softwear capture
Then, follow the prompts. You will be asked for model name, record ID, which spec file to append, and a few optional identifiers for the generated spec.
Local authentication
$ AUTH_SERVER=false bundle exec rails s
Uses data from local users.yml.
Expected format for users.yml:
"user's email":
first_name: "user's first name"
last_name: "user's last name"
profile_picture: local/file/location
roles:
- role1
- role2
- rolen
rights:
- right1
- right2
- rightn
Error handling
# In ApplicationController
include Softwear::ErrorCatcher
helper Softwear::Auth::EmailsHelper
to your application controller.
For error styling and animation add:
*= require animate/animate
.box-info-error{
background: "your desired color here";
}
to your application.css file.