DEV Community

Intro to RSpec in Rails (part 2): Improving Tests with `let` and `context`

Isa Levine on December 08, 2019

In our last post, we started to write some RSpec tests for our character-generator API, and its RandomCharacterGenerator service class. Dev.to com...
Collapse
 
cabloo profile image
Cabloo

I take this syntax one step further and use the let(:...) options to override values in each context, building up state in sub contexts: techlead.tips/2021/11/building-up-...