Run cucumber headless in 3 easy steps with rails

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.


Seguir leyendo...

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:


Seguir leyendo...

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


Seguir leyendo...

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:


Seguir leyendo...

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!


Seguir leyendo...

Metrics: rules of thumb

Here are some typical numbers you can use to save yourself spreadsheet and research time:


Seguir leyendo...

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!


Seguir leyendo...

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:


Seguir leyendo...

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\]\$ '

Seen here and here.

GD Star Rating
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:

  1. http://abdullin.com/cqrs/
  2. http://martinfowler.com/bliki/CQRS.html
  3. http://codebetter.com/gregyoung/2010/02/16/cqrs-task-based-uis-event-sourcing-agh/
  4. http://www.udidahan.com/2011/04/22/when-to-avoid-cqrs/
  5. http://www.udidahan.com/2009/12/09/clarified-cqrs/
  6. http://cqrsinfo.com/documents/
A estudiar.
GD Star Rating
loading...