Posts tagged with rspec (9)

Jun08 have_regexp custom matcher to check page content post author

rspec matcher | comments

When writing expectations on pages I like to keep them loose so they break less. I normally use the have_text matcher and I can even get looser using regexps matching but even that can break due to line breaks introduced by rendering. This is what it should be in a perfect world:

Continue reading »

May12 Ruby Nation: Lots of RSpec syntax post author

rspec syntax ruby nation | comments

For a week or two I was happily pleased with Jon Lark Larkowski RSpec presentation at Ruby Nation on RSpec syntax, and was eager to use that and other recommendations to improve my specs. Well it was time to test a helper in one of my Rails apps. Check it out, it is sweet.

Continue reading »

Feb12 paperclip attachments testing for the whole battery: RSpec and Cucumber post author

paperclip rspec cucumber | comments

Paperclip is my favourite choice for attachments, and today I needed to spec and cuke my attachments. Even though there are ways to speed your attachments tests I prefer simple, and usable all over. The trick is to create a test attachment and attach it to your models. Continue reading »

Feb04 authlogic avoiding ending up with multiple sessions post author

authlogic session rspec cucumber | comments

Authlogic is cool to handle your authentication. But in my new app the admin user was the one who created new users and updated them also. There I stumbled with a funny gotcha. Admin logged out and there was the user session of the users just created/updated. The thing is authlogic when you save a model that acts a authenticated you got a user session created. The trick is to tell authlogic to save but not creating a session. Continue reading »

Jan21 RSpec simple matcher to specify an array should be sorted post author

rspec matcher array sort | comments

RSpec is a lot about readability. And its matchers are really a joy to aid you on that. And now it is even easier to add simple matchers for (in David’s own words) you to create your own custom matchers in just a few lines of code when you don’t need all the power of a completely custom matcher object.

Continue reading »

Jul09 loading custom rspec matchers into cucumber post author

rspec cucumber matchers | comments

I happen to need to make expectations about a created user on a complex step, so when the chunk started to repeat I make myself an RSpec matcher to do that, and then load it into cucumber to be able to use it in my steps.

Continue reading »

Jan05 Aplicacion Rack para ejecutar Specs/Features en el navegador post author

rack rspec | comments

Rack: una Interface Ruby para Webservers

Rack provee una interface minima, modular y adaptable para desarrollar aplicaciones web en Ruby. Envuelve las peticiones HTTP y responde en la manera mas simple posible, unifica y destila la API para servidores web, frameworks web, y software entre ellos (los llamados middleware) en una simple llamada a un metodo.

Continue reading »

Jan05 Simple Rack app to browse/run Specs/Features on browser post author

rack rspec | comments

Rack: a Ruby Webserver Interface

Rack provides a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call.

Continue reading »

Jul15 Merb, Datamapper y RSpec: instalando edge versions post author

merb datamapper rspec edge versions | comments

Merb el framework en Ruby para hackers y su ORM de moda Datamapper se encuentran en carrera hacia la version 1.0 que saldra segun Ezra este verano. Estos dos proyectos siguen la inteligente filosofia de separar en modulos y gemas cada funcionalidad, para que vayas cargando en tu environment las funcionalidades segun las vayas necesitando. Asi se mantienen las apps ligeras y con performances ultrarapidos.

Continue reading »