self_systeem
Project | Gem Release |
---|---|
Gem name | self_systeem |
License | MIT |
Version | |
Continuous Integration | |
Test Coverage | |
Grade | |
Dependencies | |
Homepage | http://mfpiccolo.github.io/self_systeem |
Documentation | http://rdoc.info/github/mfpiccolo/self_systeem/frames |
Issues | https://github.com/mfpiccolo/self_systeem/issues |
Description
Definition: self-systeem
noun
- a realistic respect for or favorable impression of one's system
- confidence in one's system worth or abilities
- system-respect
Do you have low self-systeem? Don't worry. This gem is here to help.
self_systeem allows you to record a users interaction with your rails app in a development enviornment and automatically creates system tests based on the recordings.
It is simple. Walk through the app from sart to finish. Cover as much as you feel comfortable. That't it. You just built a system test. Congrats!
Features
After setting up self_systeem (see configuration below) use the generator to create the system test directory.
rails g self_systeem:test
Then run SELF_SYSTEEM=true rails s
Now open a new browser preferably in incognito mode so you have fresh session. Walk through your app like a normal user would. While you are doing this positive affirmations are being built in "test/system/support/systeem_booster.yml"
Now just run the test file with ruby -Itest test/system/systeem_test.rb
and watch
you tests turn green. What does this really get you? Well for one the session and
database is persisted while runnin all these tests. That means that when you are running
your tests it is essentially a recreation of all of those users actions in sequence.
Possitive affirmations:
- "Today, my system choose to see love instead of fear"
- "My system possess the qualities needed to be extremely successful"
Feeling better?
Well if those didn't work you can always check out the affirmations that you have built in systeem_booster.yml. That should do the trick.
Installation
Add this line to your application's Gemfile:
gem "self_systeem"
And then execute:
$ bundle
Or install it yourself as:
$ gem install self_systeem
Configuration
To use the generator run:
$ rails g self_systeem:test
This will set up a system folder under test with a test file and some support files.
Add this line to development.rb
config.middleware.use "SelfSysteem::AffirmationBuilder" if ENV["SELF_SYSTEEM"].present?
Temporarily change you database.yml so the development database uses the test database. This step is only while you build systeem_booster.yml file. Chage it back when you are done.
i.e.
development: &dev
adapter: postgresql
encoding: unicode
database: app_test # Change this back after creating systeem_booster.yml
pool: 5
username: <%= ENV["USER"] %>
password:
allow_concurrency: true
min_messages: warning
The Future
- Refactoring would be nice. 2.1 from codeclimate is no good.
- Boost test coverage.
- Ensure that this works with most setups. Only works with minitest, would be nice to have rspec and several rails versions working.
- Make the test database switch automatic when running rails with "SELF_SYSTEEM" env.
- Allow more configurable options possibly to allow devs to do more targeted testing post systeem_booster.yml build.
- Option to do response body matching of some sort.
- Open to suggestions. Lets start boosting that self-systeem!
Donating
Support this project and others by mfpiccolo via gittip.
Copyright
Copyright (c) 2013 Mike Piccolo
See LICENSE.txt for details.
Contributing
- Fork it ( http://github.com//self_systeem/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request