Skip to content

Commit

Permalink
Installed rspec-raisl to replace minitest
Browse files Browse the repository at this point in the history
customer_spec calling only customer fixtures

supplier model and controller. composed_email model and many-to-many relationships. #42

create composed_email action. #42

composed_email tests using rspe. #42

started update action for composed_email. TODO tests. #42

shared_example from rspec to stay DRY during testing. #42

started composed_emails_controller_spec #42

composed_emails_controller spec almost finished. #42

test for configuring my own SMTP server. #42

docker container for test uncommented. #42

composed_emails#send_email tests done. #42

validation rules for relationships enquiries and suppliers at composed_email. #42

validation rules test working adequately. #42

ammended test for composed_email. #42

Send email to suppliers server nearly done. #42

Separating development and test environments into different docker-compose files. #42

updated rails-html-sanitizer gem. #42

updated rails to 5.2.0. #42

enquiries listItem with checkbox. Started ui actions and reducers for selectedEnquiries. #42

tests for ui actions and reducers. #42

listItem checkbox integrated with ui state. #42

GET suppliers integrated into redux. Failing request response from middleware. #42

Errno::EADDRINUSE fixed for puma. TODO things for issue42

eager_load for development environment in order to prevent hanging the rails app. #42

Compose UI action. resetEnquiries when changing enquiries. #42

composeModal for sending email to supplier. Removed warnings. #42

fixed getSuppliers success reducer and test. #42

Added database setup to makefile. Updated README

spike enquiryModal including supplier, subject and body. #42

postComposedEmail integrated into UI. Real suppliers list for composeModal. #42

post composed_email integrated. #42

postComposedEmailSend action completed. #42

postComposedEmailSend functionality added into client. #42

send_email! for composed_email model finished. #42

fixed mailers/enquiries_spec. #42

mail.from and mail.reply_to through env variables. #42
  • Loading branch information
Jose Lloret authored and jollopre committed Aug 24, 2018
1 parent 18ce045 commit 5f13b2f
Show file tree
Hide file tree
Showing 83 changed files with 8,821 additions and 3,205 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
build:
docker-compose -f development.yml run --rm api bash after-start-postgres.sh rails db:setup

api_tests:
docker-compose -f test.yml run --rm api_test rspec

ui_tests:
docker-compose -f development.yml run --rm ui npm test

up:
docker-compose -f development.yml up --remove-orphans -d

down:
docker-compose -f development.yml down

default: up

32 changes: 8 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,35 @@

A tailored system for Marshall Packaging, Ltd. This repository is structured into two folders, server which contains a ruby on rails (API only mode) and client; that implements a User Interface (UI) based on react.js, react-router and redux for managing the state of the app.

The code of this repository can be installed directly on a machine, however it is provided several docker images to isolate the different parts of the system together with a docker-compose.yml to build the images and their containers in an easy manner. If you opt to choose our integrated development environment, make sure that your machine has docker and docker-compose installed first.
The code of this repository can be installed directly on a machine, however it is provided several docker images to isolate the different parts of the system.

### Build

In order to build the rails part, please execute the following command:

```
docker-compose run api bash after-start-postgres.sh rails db:setup
$ make build
```
The above command should be executed just once unless you encounter an unsuccessful output after running it.

### Run

In order to run the containers, i.e. the isolated parts for db, api and UI, please type the following command:
### Run in background

```
docker-compose up -d
$ make up
```

Bear in mind that the first time, the above command will build different images (e.g. postgres for the db, rails for the api and nodejs for UI). If everything went well, the api and the UI should be accessible through the ports 3000 and 8080 respectively. Please, make sure that you don't have anything already running on those ports.

Use the UI by typing the following address on your prefered browser:
The UI should be reachable at:

```
http://localhost:8080
```

where a sign in form is presented. Please, use the default username and password provided to gain access (e.g. "user@somewhere.com" and "secret_password").

Since the API and UI code, accessible through server and client folders, are volume mounted on their respective running container, it is easy to make changes in code and see results straightaway. Note, the UI has hot-reloading integrated, therefore there is no need to refresh the browser after making changes.
Please, use the default username and password provided to gain access (e.g. "user@somewhere.com" and "secret_password").

## Testing

If you want to test the code, there are already unit and functional test in place for the api. Please, type the following command to
execute the tests in place:

```
docker-compose run api bash after-start-postgres.sh rails test RAILS_ENV=test
$ make api_tests
```

## Shutdown

Once you finish using the system, you can stop and remove the containers safely by running:

```
docker-compose rm -sf
$ make down
```
Remember that any data generated after using the system is not ephemeral thanks to the docker volume mounted for the postgres container running.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ Issue 29:
Issue 18:
- Provide nice messages when there is no data after requesting a resource (e.g. search for orders, etc)
- Add quantity into export order_item

4 changes: 1 addition & 3 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ RUN npm install

VOLUME /usr/src/app

EXPOSE 3000

CMD ["npm", "start"]
CMD ["npm", "start"]
Loading

0 comments on commit 5f13b2f

Please sign in to comment.