Relative Content

Tag Archive for rspec

Should I be writing feature or request specs?

I’ve been writing model specs for a while now and I’m gradually moving towards integration testing. Right now, I’m looking at the best way to test the output of my ActiveAdmin dashboard but I’m unsure which is the best type of spec for the job.

Should you mock key-value stores/aggregators

I’ve always been taught that your tests should run in isolation, and other than a db for ActiveRecord etc., your tests should not rely on any external software/services. e.g. I always mock my other web-service responses but what about responses from web based key-value stores and aggregators like elasticsearch, redis, and statsd? My intuition would be to mock those as well as I am not testing if they work I am testing my apps IO with them. However I see examples around where people uses namespace strategies to test their elasticsearch and statsd related code.

Should you mock key-value stores/aggregators

I’ve always been taught that your tests should run in isolation, and other than a db for ActiveRecord etc., your tests should not rely on any external software/services. e.g. I always mock my other web-service responses but what about responses from web based key-value stores and aggregators like elasticsearch, redis, and statsd? My intuition would be to mock those as well as I am not testing if they work I am testing my apps IO with them. However I see examples around where people uses namespace strategies to test their elasticsearch and statsd related code.