Example Rails Coding Challenge by ShowMojo
Note: This task should take no longer than 1-2 hours at the most to complete.
Please note that this will require some basic Ruby on Rails and RSpec knowledge.
You will need to have Ruby on Rails installed to complete this task.
{
"id": 9923,
"created": 1389618241,
"paid": true,
"amount": 4900,
"currency": "usd",
"refunded": false,
"customer_id" : 123
}
*Note: Amount is in USD, cents*
The charge object has a customer property, this property is the customer id from the customer model.
Customer 1:
First Name: Johny
Last Name: Flow
Customer 2:
First Name: Raj
Last Name: Jamnis
Customer 3:
First Name: Andrew
Last Name: Chung
Customer 4:
First Name: Mike
Last Name: Smith
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
On the view that shows all charges (most likely the GET /charges route), create three lists with H1 headers.
List 1 -
List 2 -
List 3 -
Create the following RSpec tests: