Rails Engine is an e-commerce application that tracks merchants, customer, items, and invoices. Information is stored in a database and accessed via internal api between Front-End and Back-End pieces of the application.
- Exposing an API
- Use serializers to format JSON responses
- Test API exposure
- Compose advanced ActiveRecord queries to analyze information stored in SQL databases
- Ruby 2.5.3
- Rails 5.2.4.4
-
Create a directory (e.g. rails_engine) as a parent directory
-
cd
into that directory and run the following commands:- To clone the front end repo of this project that contains a test suite
git clone git@github.com:turingschool-examples/rails_driver.git
- To clone the back end repo of this project
git clone git@github.com:jakeheft/rails_engine.git
Both of these directories should live inside the parent directory you made
-
cd
into rails_engine (child directory) and runbundle install
and thenrails g rspec:install
-
From inside the rails_engine (child directory), run
rails db:{drop,create,migrate,seed}
. To get the spec harness to pass (see 'Running Tests' below), you will need to have the database properly seeded.
To test the interconnectivity of this application with the Front-End application (rails_driver), run rails s
while inside this project's root directory (rails_engine child directory). Then in another terminal window, run bundle exec rspec spec/features/harness_spec.rb
to run the tests.
The Back-End has also been fully tested with 100% test coverage in SimpleCov.