Test Driving a Rails API - Part Two

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. dotenv

    A Ruby gem to load environment variables from `.env`. (by bkeepers)

    This is the second part of my Test Driving a Rails API series. In Part 1 we set up our development environment, generated a Rails API-only application, installed dotenv to easily store configuration values in the environment, and installed and configured PostgreSQL version 16 as our database.

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. minitest

    minitest provides a complete suite of testing facilities supporting TDD, BDD, mocking, and benchmarking.

    In this part, we’ll set up our testing environment so that we can test our Rails API using minitest with minitest/spec. We’ll look at the differences between traditional style unit tests and spec-style tests, or specs. I’ll demonstrate why you should use minitest-rails. We’ll look at using rack-test for testing our API. We’ll even create our own generator to generate API specs.

  4. rspec-rails

    RSpec for Rails 7+

    When starting a Rails project, you have a lot of decisions to make. Whether or not to write tests should not be one of them. The big decision is to use Minitest or Rspec. Both of those testing frameworks are great and provide everything you need to test a Rails application thoroughly.

  5. minitest-rails

    Minitest integration for Rails

    How do we tell minitest/spec which test class to use? The tldr is to use the minitest-rails gem. I highly recommend adding the minitest-rails gem to your project. The gem does a lot to integrate the Rails testing ecosystem with Minitest, particularly spec-style tests. One primary benefit is that it configures specs to use ActiveSupport::TestCase or one of its subclasses as the spec’s test class, depending on what is passed describe.

  6. rack-test

    Rack::Test is a small, simple testing API for Rack apps.

    In this part, we’ll set up our testing environment so that we can test our Rails API using minitest with minitest/spec. We’ll look at the differences between traditional style unit tests and spec-style tests, or specs. I’ll demonstrate why you should use minitest-rails. We’ll look at using rack-test for testing our API. We’ll even create our own generator to generate API specs.

  7. factory_bot_rails

    Factory Bot ♥ Rails

    While we’re at it, let's add a couple of other gems we’ll need for our test environment: factory_bot_rails is a fixtures replacement and generates test model instances. faker is handy for generating fake strings of data to be used in tests. Add those gems to the development and test group of your Gemfile:

  8. faker

    A library for generating fake data such as names, addresses, and phone numbers. (by faker-ruby)

    While we’re at it, let's add a couple of other gems we’ll need for our test environment: factory_bot_rails is a fixtures replacement and generates test model instances. faker is handy for generating fake strings of data to be used in tests. Add those gems to the development and test group of your Gemfile:

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • How to Use Shoulda Matchers with RSpec for Ruby on Rails

    6 projects | dev.to | 20 Dec 2023
  • A library for setting up Ruby objects as test data

    1 project | news.ycombinator.com | 3 May 2025
  • 3 useful VS Code extensions for testing Ruby code

    2 projects | dev.to | 8 Nov 2024
  • Faker – generate fake data such as names, addresses, and phone numbers

    1 project | news.ycombinator.com | 13 Apr 2024
  • Show HN: Factory-JS – TypeScript dummy object generator for testing

    2 projects | news.ycombinator.com | 29 Mar 2024

Did you know that Ruby is
the 12th most popular programming language
based on number of references?