Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/alejandroq12/api-testing-rspec

The API Testing Spec is a project designed to practice API testing with RSpec.
https://github.com/alejandroq12/api-testing-rspec

rspec ruby-on-rails

Last synced: about 2 months ago
JSON representation

The API Testing Spec is a project designed to practice API testing with RSpec.

Awesome Lists containing this project

README

        

# api-testing-spec



main-logo


API Testing Spec



# 📗 Table of Contents

- [api-testing-spec](#api-testing-spec)
- [📗 Table of Contents](#-table-of-contents)
- [📖 API Testing Spec ](#-api-testing-spec-)
- [🛠 Built With ](#-built-with-)
- [Tech Stack ](#tech-stack-)
- [Key Features ](#key-features-)
- [💻 Getting Started ](#-getting-started-)
- [Prerequisites](#prerequisites)
- [Setup](#setup)
- [Install](#install)
- [Database](#database)
- [Usage](#usage)
- [Run tests](#run-tests)
- [Run linter](#run-linter)
- [Deployment](#deployment)
- [Test with postman](#test-with-postman)
- [👥 Authors ](#-authors-)
- [🔭 Future Features ](#-future-features-)
- [🤝 Contributing ](#-contributing-)
- [⭐️ Show your support ](#️-show-your-support-)
- [🙏 Acknowledgments ](#-acknowledgments-)
- [❓ FAQ ](#-faq-)
- [📝 License ](#-license-)

# 📖 API Testing Spec

The API Testing Spec is a project designed to practice API testing. This project is based on a written tutorial, which I will reference below. I chose a written tutorial because, after creating this small project, I plan to implement testing in my own project, utilizing the knowledge I gained from here, alongside reading the documentation and some books.

## 🛠 Built With

### Tech Stack

### Key Features

- **Use RSpect to test API**

(back to top)

## 💻 Getting Started

To get a local copy up and running, follow these steps.

### Prerequisites

In order to run this project you need:

[Install Ruby](https://www.ruby-lang.org/en/documentation/installation/)

### Setup

```sh
cd my-folder
git clone https://github.com/Alejandroq12/api-testing-rspec.git
```

### Install

Install all necessary dependencies listed in the `Gemfile`.

```sh
bundle install
```

### Database

Create databse:

```sh
rake db:create
```

Run migrations:

```sh
rails db:migrate
```

Add the seeds(omit it for this project):

```sh
rails db:seed
```

### Usage

To run the project, navigate to the project directory and execute the following command:

```sh
rails server
```

### Run tests

To run tests, run the following command:

```sh
rspec
```

### Run linter

To run linter, run the following command:

```sh
rubocop
```

### Deployment

You can deploy this project using:

Not available at the moment.

(back to top)

### Test with postman

Send a POST request with valid parameters:
![Alt text]()
Answer of a POST request with valid parameters:
![Alt text](postman_one_valid_parameters.png)

Send a POST request with invalid parameters:
![Alt text](test_postman_two.png)
Error as a result of a POST request with invalid parameters:
![Alt text](error_postman_two_invalid.png)

(back to top)

## 👥 Authors

👤 **Julio Quezada**

- GitHub: [Alejandroq12](https://github.com/Alejandroq12)
- Twitter: [@JulioAle54](https://twitter.com/JulioAle54)
- LinkedIn: [Julio Quezada](https://www.linkedin.com/in/quezadajulio/)

(back to top)

## 🔭 Future Features

- [] **Test CRUD actions.**
- [] **Create a health check controller.**
- [] **Create a CRUD acaffold.**
- [] **Test autehtication.**

(back to top)

## 🤝 Contributing

Contributions, issues, and feature requests are welcome!

(back to top)

## ⭐️ Show your support

If you like this project please give a star.
Thanks in advance.

(back to top)

## 🙏 Acknowledgments

I would like to thank Axel Kee for creating the written tutorial for this project [Axel Kee](https://rubyyagi.com/rspec-request-spec/)

(back to top)

## ❓ FAQ

**What did you learn?**

- I learned a lot about testing CRUD actions, testing authentication, testing request specs, and setting up a Rails app.

(back to top)

## 📝 License

This project is [MIT](./LICENSE) licensed.

(back to top)