-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from tan12082001/test-models
Test models
- Loading branch information
Showing
12 changed files
with
385 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,169 @@ | ||
# README | ||
<a name="readme-top"></a> | ||
|
||
This README would normally document whatever steps are necessary to get the | ||
application up and running. | ||
<div align="center"> | ||
|
||
Things you may want to cover: | ||
</div> | ||
|
||
* Ruby version | ||
|
||
* System dependencies | ||
# 📗 Table of Contents | ||
|
||
* Configuration | ||
- [📖 About the Project](#about-project) | ||
- [🛠 Built With](#built-with) | ||
- [Tech Stack](#tech-stack) | ||
- [Key Features](#key-features) | ||
- [💻 Getting Started](#getting-started) | ||
- [Setup](#setup) | ||
- [Prerequisites](#prerequisites) | ||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [Run tests](#run-tests) | ||
- [Frontend Repository](#frontend-repository) | ||
- [ERD Image](#erd-image) | ||
- [API Documentation](#api-documentation) | ||
- [👥 Authors](#authors) | ||
- [🔭 Future Features](#future-features) | ||
- [🤝 Contributing](#contributing) | ||
- [⭐️ Show your support](#support) | ||
- [🙏 Acknowledgements](#acknowledgements) | ||
- [❓ FAQ (OPTIONAL)](#faq) | ||
- [📝 License](#license) | ||
|
||
* Database creation | ||
# 📖 vehicle booking app <a name="about-project"></a> | ||
|
||
* Database initialization | ||
**vehicle booking app** is a Booking app made connectively with Ruby in Rails and React for front-end [vehicle booking app](https://github.com/tan12082001/Vehicle-Booking-App-Backend.git) React frontend App in JSON format through an API endpoint. | ||
|
||
* How to run the test suite | ||
## 🛠 Built With <a name="built-with"></a> | ||
|
||
* Services (job queues, cache servers, search engines, etc.) | ||
### Tech Stack <a name="tech-stack"></a> | ||
<details> | ||
<summary>Client</summary> | ||
<ul> | ||
<li><a href="https://react.dev/">React</a></li> | ||
<li><a href="https://react-redux.js.org/">React-Redux</a></li> | ||
<li><a href="https://redux-toolkit.js.org/">Redux Toolkit</a></li> | ||
</ul> | ||
</details> | ||
|
||
* Deployment instructions | ||
<details> | ||
- <summary>Server</summary> | ||
<ul> | ||
<li><a href="https://guides.rubyonrails.org/">Ruby on Rails</a></li> | ||
<li><a href="https://www.postgresql.org/docs/">PostgreSQL</a></li> | ||
</ul> | ||
</details> | ||
|
||
* ... | ||
### Key Features <a name="key-features"></a> | ||
|
||
- Rails API backend | ||
- React Front-end | ||
- Redux Toolkit used to consume the backend api | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
## 💻 Getting Started <a name="getting-started"></a> | ||
|
||
To get a local copy up and running, follow these steps: | ||
|
||
### Prerequisites | ||
|
||
In order to run this project you need: | ||
- A text editor of your choice ([VS Code](https://code.visualstudio.com/download) works well). | ||
- [Ruby and Rails](https://gorails.com/setup/windows/10) | ||
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) | ||
|
||
### Setup | ||
|
||
Use the following URL to clone this project: | ||
|
||
https://github.com/tan12082001/Vehicle-Booking-App-Backend.git | ||
|
||
### Install | ||
Open the terminal in the root directory of the project and run the following command to install all dependencies. | ||
|
||
bundle install | ||
|
||
### Frontend Repository | ||
Reference the [Frontend Repository](https://github.com/tan12082001/Vehicle-Booking-App-Frontend.git) for the corresponding frontend. | ||
|
||
### ERD Image | ||
Add an ERD image to visualize the database schema. | ||
## follow the below link to access | ||
(https://drawsql.app/teams/wineshuga/diagrams/book-appointment) | ||
|
||
### API Documentation | ||
Reference the API documentation for details on how to interact with the API. | ||
|
||
### Usage | ||
To start the development server, run the following command then navigate to `localhost:3000` in your browser. | ||
|
||
rails s | ||
|
||
Open [http://localhost:3000](http://localhost:3000/api/random_greeting) to view it in your browser. | ||
|
||
|
||
### Run tests | ||
There are no tests to run. | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
||
## 👥 Authors <a name="authors"></a> | ||
|
||
|
||
👤 **Suleiman Gacheru** | ||
|
||
- GitHub: [@hetrox8](https://github.com/hetrox8) | ||
- Twitter: [@suleimangacheru](https://twitter.com/suleimangacheru) | ||
|
||
|
||
👤 **Tanmayi manku** | ||
|
||
- GitHub: [@tan12082001](https://github.com/tan12082001) | ||
|
||
|
||
👤 **Winnie uzochukwu** | ||
|
||
- GitHub: [@winnie](https://github.com/Wineshuga) | ||
|
||
👤 **Winnie uzochukwu** | ||
|
||
- GitHub: [@toyybi bolaji](https://github.com/Simpleshaikh1) | ||
|
||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
||
## 🔭 Future Features <a name="future-features"></a> | ||
|
||
- None planned | ||
|
||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
## 🤝 Contributing <a name="contributing"></a> | ||
|
||
Contributions, issues, and feature requests are welcome! | ||
|
||
Feel free to check the [issues page](../../issues/). | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
## ⭐️ Show your support <a name="support"></a> | ||
|
||
|
||
If you like this project, please give it a star ⭐️ and share it with your friends. | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
||
## 🙏 Acknowledgments <a name="acknowledgements"></a> | ||
|
||
I would like to thank <a href="https://www.microverse.org/">Microverse</a> for providing the resources and guidelines that enabled me to complete this project. | ||
|
||
<p align="right">(<a href="#readme-top">back to top</a>)</p> | ||
|
||
|
||
|
||
## 📝 License <a name="license"></a> | ||
|
||
This project is [MIT](./LICENSE) licensed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
fAtn19uLyNhgX/ZDtLX9gOmxM3j7ftyeD5FGXTr5TurQX1rvjgBdnm0UHa7hQW9zKTgW/8u36rGIsHkv7FXQNdQ973rqx622S76o7TTuxZ1ihrhKKDBZhb9L4tIxMOHhLxGvuUf8ztIP2LkuF6s4KhJxf5yQop+zKbasaxcdTHwAzNmx1E6gxiaQiRGSDqIkMKHllGjmc3rNT44N7z9I+h9Zm+J+mgrIcKU8lZ+tGbVNkE9dJoGGrWLFDeuP54liacjmiZACmMEq1E9QA7pyvDaL60PD678SLktthGbVbgySU2xg+TawbHTt9mkr458+padCCi3CV5JAcdKfG2uH8XgDdzKiXKXuFIkPNfhFL8msOhe0R0FiHlchWOelXYgMNAAbfR7Oxv2Rez08OCWn8DJFdmFf--1bfvO5+kKjsedmRn--3ahtbfXpTxPynTpxpi2WXg== | ||
Ub4GwFY64RuGmN4tF3T5NYa41bAEZFrbj2pAVHLkK0ERfIr8/I5mUxuJ2xQKuF2JRL2spC1jOhWTKyTS+7KphFxc25b4CuYsaBm5mI2Q4WGq+RdYKBr1F5fISRWFuEKVw0uSTg3Iu7wLvU0kBsyvrb4lvV15Q4ZrRLH74GDeZFGZMwbilbVX1Pjxv08GO/hHUksjZahlouqiYNtdVQU5ddM/TKScWeBiBt6VVl3r4u5Mmu9K2cIABpmGTaWWS1t8C+G9Afx93+8E4en9c+Vefn0jl0iP38ab9UrnzD5sV9jds/xSg5I1m/txc/OozZCypJRnIgifnEvas1U7thoZIkqMxNgqgtJ3wWM99gZPHMQ5APnMrwKamctsE9wjSNg9a6s9aj33EMBx+g2WdUkL2fLWM9LK--RXyuCv1yyZ786dyc--t1D0aqw6YPSrnsMMF+/oRA== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe Car, type: :model do | ||
describe 'associations' do | ||
it { is_expected.to have_many(:my_reservations) } | ||
it { is_expected.to have_many(:users).through(:my_reservations) } | ||
end | ||
|
||
# Add tests for other validations here | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe MyReservation, type: :model do | ||
describe 'associations' do | ||
it { is_expected.to belong_to(:user) } | ||
it { is_expected.to belong_to(:car) } | ||
end | ||
|
||
# Add tests for other validations here | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
require 'rails_helper' | ||
|
||
RSpec.describe User, type: :model do | ||
describe 'associations' do | ||
it { is_expected.to have_many(:my_reservations) } | ||
it { is_expected.to have_many(:cars).through(:my_reservations) } | ||
end | ||
|
||
# Add tests for other validations here | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# spec/rails_helper.rb | ||
|
||
# This file is copied to spec/ when you run 'rails generate rspec:install' | ||
require 'spec_helper' | ||
ENV['RAILS_ENV'] ||= 'test' | ||
require File.expand_path('../config/environment', __dir__) | ||
require 'rspec/rails' | ||
require 'shoulda/matchers' | ||
require 'database_cleaner' | ||
|
||
# Prevent database truncation if the environment is production | ||
abort('The Rails environment is running in production mode!') if Rails.env.production? | ||
|
||
# Checks for pending migrations and applies them before tests are run. | ||
# If you are not using ActiveRecord, you can remove these lines. | ||
begin | ||
ActiveRecord::Migration.maintain_test_schema! | ||
rescue ActiveRecord::PendingMigrationError => e | ||
abort e.to_s.strip | ||
end | ||
|
||
RSpec.configure do |config| | ||
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures | ||
config.fixture_paths = [ | ||
Rails.root.join('spec/fixtures') | ||
] | ||
|
||
# If you're not using ActiveRecord, or you'd prefer not to run each of your | ||
# examples within a transaction, remove the following line or assign false | ||
# instead of true. | ||
config.use_transactional_fixtures = true | ||
|
||
# You can uncomment this line to turn off ActiveRecord support entirely. | ||
# config.use_active_record = false | ||
|
||
# Configure shoulda-matchers | ||
Shoulda::Matchers.configure do |shoulda_config| | ||
shoulda_config.integrate do |with| | ||
with.test_framework :rspec | ||
with.library :rails | ||
end | ||
end | ||
|
||
# Configure DatabaseCleaner | ||
config.before(:suite) do | ||
DatabaseCleaner.strategy = :transaction | ||
DatabaseCleaner.clean_with(:truncation) | ||
end | ||
|
||
config.before(:each) do | ||
DatabaseCleaner.start | ||
end | ||
|
||
config.after(:each) do | ||
DatabaseCleaner.clean | ||
end | ||
|
||
# RSpec Rails can automatically mix in different behaviours to your tests | ||
# based on their file location, for example enabling you to call `get` and | ||
# `post` in specs under `spec/controllers`. | ||
# | ||
# You can disable this behaviour by removing the line below, and instead | ||
# explicitly tag your specs with their type, e.g.: | ||
# | ||
# RSpec.describe UsersController, type: :controller do | ||
# # ... | ||
# end | ||
# | ||
# The different available types are documented in the features, such as in | ||
# https://rspec.info/features/6-0/rspec-rails | ||
config.infer_spec_type_from_file_location! | ||
|
||
# Filter lines from Rails gems in backtraces. | ||
config.filter_rails_from_backtrace! | ||
# arbitrary gems may also be filtered via: | ||
# config.filter_gems_from_backtrace("gem name") | ||
end |
Oops, something went wrong.