https://github.com/renanrboliveira/wit-cart
Test for witliving
https://github.com/renanrboliveira/wit-cart
codeclimate rails rspec-rails ruby travis-ci
Last synced: 2 months ago
JSON representation
Test for witliving
- Host: GitHub
- URL: https://github.com/renanrboliveira/wit-cart
- Owner: renanrboliveira
- Created: 2017-10-30T20:24:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-31T15:06:17.000Z (over 8 years ago)
- Last Synced: 2025-06-05T18:48:55.603Z (about 1 year ago)
- Topics: codeclimate, rails, rspec-rails, ruby, travis-ci
- Language: HTML
- Homepage:
- Size: 187 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Documenation
[](https://travis-ci.org/renanrboliveira/wit-cart)
[](https://codeclimate.com/github/renanrboliveira/wit-cart/maintainability)
[](https://codeclimate.com/github/renanrboliveira/wit-cart/test_coverage)
Wit pratical test
---
### Requirements ###
* **[Ruby 2.4.2](https://www.ruby-lang.org/en/)**
* **[Rails 5.1.4](http://guides.rubyonrails.org/)**
* **[PostgreSQL 9.6](https://www.postgresql.org/)**
## First step
You can choose use the [traditional installation](#traditional-installation) **or** use the project with [Docker](#docker-optional-installation).
## Traditional Installation
Install RVM: [see RVM installation guide](http://rvm.io).
### Install Ruby
```sh
$ rvm install ruby-2.4.2
```
### Install nodejs
```sh
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
```
### Install bundler
```sh
$ gem install bundler --no-ri --no-rdoc
```
### Perform bundle install
```sh
$ bundle install
```
### Install PostgreSQL
*Ubuntu 16.10*
```sh
$ sudo add-apt-repository "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main"
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.6
```
*Or see PostgreSQL installation [WIKI](https://wiki.postgresql.org/wiki/Detailed_installation_guides)*.
### Setup your .env(s)
```bash
$ cp -pRfv .env.production.sample .env.production
$ cp -pRfv .env.development.sample .env.development
$ cp -pRfv .env.test.sample .env.test
```
Update your .env.prouction, .env.development or .env.test if necessary.
### configure bundle for postgresql
```sh
$ bundle config build.pg --with-pg-config=/path/to/pg_config
```
### Configure the database development
```sh
$ bundle exec rake db:create
$ bundle exec rake db:migrate
```
### Run application
```sh
$ bundle exec rails s -b 0.0.0.0
```
### Testing
**Configure the database tests**
```sh
$ RAILS_ENV=test bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rake db:test:prepare
```
**Rspec**
```sh
$ bundle exec rspec
```
## Docker (optional installation)
**Install Docker [here](https://docs.docker.com/engine/installation/)**
Build images:
```sh
$ make rebuild
```
Create databases:
```sh
make docker-createdb
```
Start the application:
```sh
$ make up
```
If you need use another instance of application in Docker (for run the rails console for example):
```sh
make bash
```
To finish all Docker instances:
```sh
$ make down
```
**Access**: [http://localhost:3000](http://localhost:3000)
**pgAdmin4**: [http://localhost:5050](http://localhost:5050)