Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zangrandi/rails-challenge-other
https://github.com/zangrandi/rails-challenge-other
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zangrandi/rails-challenge-other
- Owner: zangrandi
- Created: 2018-01-19T15:46:28.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-19T15:47:40.000Z (almost 7 years ago)
- Last Synced: 2024-11-08T05:31:11.405Z (2 months ago)
- Language: Ruby
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Rails Programming Task
### In order to be considered for a Rails position, you must complete the following steps.
*Note: This task should take no longer than 1-2 hours at the most to complete.*### Prerequisites
- Please note that this will require some basic [Ruby on Rails](http://rubyonrails.org/) and [RSpec](http://rspec.info/) knowledge.
- You will need to have [Ruby on Rails](http://www.rubyonrails.org/) installed to complete this task.
## Task
- Fork this repository (if you don't know how to do that, Google is your friend).
- Create a *source* directory.
- In the *source* directory, scaffold a simple Rails 4 web app that models a credit card charge. JSON data structure below:```
{
"id": 9923,
"created": 1389618241,
"paid": true,
"amount": 4900,
"currency": "usd",
"refunded": false,
"customer_id" : 123
}
```*Note: Amount is in USD, cents*
- Also scaffold a customer object which only has a first and last name.
*The charge object has a customer property, this property is the customer id from the customer model.*
##### Seed 4 Customers into the system:
Customer 1:
First Name: Johny
Last Name: FlowCustomer 2:
First Name: Raj
Last Name: JamnisCustomer 3:
First Name: Andrew
Last Name: ChungCustomer 4:
First Name: Mike
Last Name: Smith
##### Seed 20 transactions (charges) into the system:10 Should be successful transactions:
- 5 Should be linked to Customer 1
- 3 Should be linked to Customer 2
- 1 Should be linked to Customer 3
- 1 Should be linked to Customer 4
5 Should be transactions that failed:
- 3 Should be linked to Customer 3
- 2 Should be linked to Customer 4
5 should be disputed:
- 3 should be linked to Customer 1
- 2 should be linked to customer 2##### Create a Visual Representation of Different Charges:
On the view that shows all charges (most likely the *GET /charges* route), create three lists with H1 headers.
- List 1 -
- Header: Failed Charges
- In this list set the background color of the rows to #FF0000 and list the Customers name, the charge amount and the date that the charge failed for each failed charge.- List 2 -
- Header: Disputed Charges
- In this list set the background color of the rows to ##FF5400 and list the Customers name, the charge amount and the date that the charge was disputed for each disputed charge.- List 3 -
- Header: Successful Charges
- In this list simply display all the charges that were succesful.### Tests
Create the following RSpec tests:
1. Verify that there are three lists on the screen. One for successful charges, one for failed charges and one for the disputed charges.
2. Verify that in the Successful charges list there are 10 line items. Verify that in the failed charges list there are 5 failed charges. Verify that in the disputed charges list there are failed charges.## Once Complete
1. Commit and Push your code to your new repository
2. Send us a pull request, we will review your code and get back to you