O'Reilly logo

The Cucumber Book, 2nd Edition by Steve Tooke, Aslak Hellesoy, Matt Wynne

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 10Databases

Back in Chapter 6, When Cucumbers Go Bad we described the risks associated with leaky scenarios, where data left behind by one scenario affects the results of the next. In this chapter we’re going to illustrate this problem with an example, and we’ll describe the two methods for dealing with it, along with their advantages and disadvantages.

For this final installment of the worked example, we’re going to introduce a relational database into our ATM system. Almost every system you’ll write Cucumber tests for will have a database of some kind, and it helps to know how to talk to it directly from your test code. You can use ActiveRecord to connect to almost any kind of database and set up or inspect its data from your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required