Sentia's Rails application coding test.
An example Ruby on Rails application that can import information and display
it.
The application comes from a coding test, and I decided to take it on just
because I felt like I had not created a Rails application from scratch for a
while.
The application is currently deployed here using Heroku.
I wrote more about this codebase, and my rationale for all the major development
decisions, in the following blog post:
git clone https://github.com/paulfioravanti/sentia-coding-test.git
cd senta-coding-test
bundle install
bin/rails db:init
yarn
bin/rails server
Open http://localhost:3000 in a browser and you should be greeted with
an empty table.
The original CSV file containing the data that the application must be able to
import can be found at:
test/fixtures/files/SentiaCodingTestData.csv
This is the file that can be selected upon pressing the “Import Data” button
to import the required data.
During development, I also recreated the seed data in Rails fixtures files,
which can be found under the test/fixtures
directory. These can be loaded
into the database on the command line:
bin/rails db:fixtures:load
I often tested the logic in the file importer modules themselves via the Rails
console, so the data can also be imported in the following way:
bin/rails console
irb(main):001:0> file = File.open("#{Rails.root}/test/fixtures/files/SentiaCodingTestData.csv")
irb(main):002:0> DataImporter.import(file)
Push to Heroku with the following command:
git push heroku main
No tests. Too lazy for this one.
You will be required to create a Ruby on Rails application with the following
features below. The sample CSV data required for the test can be found
here. This application can be built in 1 hour.
Below is a list of user stories and requirements for each section of this
application.
PART 1
As a user, I should be able to upload this sample CSV and import the data
into a database.
IMPORTER REQUIREMENTS
a. The data needs to load into 3 tables. People, Locations and
Affiliations
b. A Person can belong to many Locations
c. A Person can belong to many Affiliations
d. A Person without an Affiliation should be skipped
e. A Person should have both a first_name and last_name. All fields
need to be validated except for last_name, weapon and vehicle which
are optional.
f. Names and Locations should all be titlecased
PART 2
Once the test has been completed. Please upload to Git Repo/Google Drive/DropBox
or zip and email over back to \