Skip to main content

Questions tagged [rspec]

6 votes
3 answers
4k views

Currently working on a Ruby-on-Rails codebase, testing is done with Rspec. We use BuildKite to run tests. We are in a situation where sometimes tests will fail, and upon a retry or two, pass. AKA, we ...
Julien Chien's user avatar
2 votes
2 answers
163 views

Maybe that's simple, but it confuses me. I have such a code now: describe VarnishLogExaminer::Entry do let(:entry) do file_string = File.read('./spec/assets/varnish_example.xml') ...
Karol Selak's user avatar
0 votes
1 answer
151 views

I'm very new to ruby. I have to code in ruby at work and a coworker gave me some tests he wrote in ruby. I have some difficulties to understand a line he wrote. We have a class like this: class Port ...
user3314570's user avatar
1 vote
3 answers
143 views

I have couple hundred tests and I work with date/time a lot. In some tests, I aim for output format, elsewhere, I check date ranges. Therefore, my tests have lots of these: FactoryGirl.create(:foo, ...
rdamborsky's user avatar
3 votes
2 answers
1k views

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 ...
kreek's user avatar
  • 317
0 votes
1 answer
160 views

I am trying to write a couple of classes using SOLID principles and having some trouble. The problem is quite simple. I have an application that tracks leads. Leads are created when events are raised ...
Ryan-Neal Mes's user avatar
1 vote
2 answers
1k views

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 ...
tristanm's user avatar
  • 113
4 votes
1 answer
3k views

Please can someone explain to me how I should go about deciding whether to use expect or should syntax for my rspec examples. From my understanding we should no longer be using the 'should' syntax. ...
Ryan-Neal Mes's user avatar