If you relay heavily in cucumber for your integration and/or acceptance tests, it can quite easily grow out of your reach, thus making necessary to improve running time of tests. One of the best techniques that can lower your testing times is running cucumber in headless mode.
Customizing devise routes
I was reading through the devise gem source trying to learn something and I came across this: http://rdoc.info/github/plataformatec/devise/master/ActionDispatch/Routing/Mapper
It is like a bag of tricks for customizing the routes generated by devise, where you can pass a lot of ‘hidden’ options to the devise_for helper. I found specially nice these:
On testing resque
Some times it is hard to configure or slow to execute our resque queues in the testing environment. In those cases, we can use the monkeypatching ability of ruby to directly execute the jobs and by-pass the workers. Put this wherever you like but make sure to load it (in spec/support or features/support or config/initializers..):
resque_hack.rb
Quick tip in testing devise
If you are testing Devise and want a little more speed if you are creating lots of users in your tests, put this into config/initializers/devise.rb:
config.stretches = Rails.env.test? ? 1 : 10
Also, if you are having problems with the sign_out route and testing, maybe it could help to make it a GET route (instead of a DELETE one) whilst testing:
Quick trick to improve testing time w/ sqlite, cucumber & rspec in rails
For the average rails developer is quite common to use sqlite as a development and testing database, because it is quick to start using and has little system overhead, but it performs horribly. A nice and quick way to improve the overall speed is to put in memory the sqlite database, so the bottleneck is removed. We have improved our cucumbers from 12m to 3m!
Metrics: rules of thumb
Here are some typical numbers you can use to save yourself spreadsheet and research time:
Having fun with postcards
This summer I’ve been travelling a lot with my wife. And sometimes, if we find the time and the place, some ‘postcarding‘ takes place. In this case, my wife wanted to send a bunch of postcards to his co-workers but adding some fun. We quickly came up with a great idea, encrypt the cards!
Improved history management in bash
Dejo aquí reproducido un correo de mi buen amigo Mario:
Estaba un poco harto de darle para arriba a la flechita en el
terminal… y he buscado algun truquillo ideal para unix hackers, a
ver si os gusta:~/.bashrc:
Git prompt and autocompletion
To be put in .bashrc or .bash_profile
# Set git autocompletion and PS1 integration
if [ -f /usr/local/git/contrib/completion/git-completion.bash ]; then
. /usr/local/git/contrib/completion/git-completion.bash
fi
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
fi
export GIT_PS1_SHOWDIRTYSTATE=true
export GIT_PS1_SHOWUNTRACKEDFILES=true
PS1='\u@\h:\w\[\033[32m\]$(__git_ps1)\[\033[00m\]\$ '

loading...
CQRS – Command and Query Responsibility Segregation.
Hablando con un amiguete el otro día salió a relucir la arquitectura CQRS. Mi cara de poker fue espectacular. Por lo tanto, por aquí os dejo alguna referencia para profundizar en el tema:
- http://abdullin.com/cqrs/
- http://martinfowler.com/bliki/CQRS.html
- http://codebetter.com/gregyoung/2010/02/16/cqrs-task-based-uis-event-sourcing-agh/
- http://www.udidahan.com/2011/04/22/when-to-avoid-cqrs/
- http://www.udidahan.com/2009/12/09/clarified-cqrs/
- http://cqrsinfo.com/documents/
loading...