using utilities function on Rspec

Signed-off-by: oscarsan <oscarsanhueza@gmail.com>

With this utility function we avoid to
write down extra lines, and we can use them
in case it is needed more often in the tests.