Skip to content

binos30/blog-app

Repository files navigation

Setup

Prerequisites

Create .env file at the root of the project directory. Copy the content of .env.template.erb to .env then update the username and password based on your database credentials. To send a post feedback email to the blog post author, request SENDGRID_API_KEY from admin/owner or create your own SENDGRID_API_KEY and add single sender verification then update SENDGRID_FROM_EMAIL and SENDGRID_FROM_NAME

Install dependencies and setup database

bin/setup

Populate database with sample data

rake db:populate_sample_data

Start local web server

bin/dev

Go to http://localhost:3000

Testing

Setup test database

bin/rails db:test:prepare

Default: Run all spec files (i.e., those matching spec/**/*_spec.rb)

rspec

Run all spec files in a single directory (recursively)

rspec spec/models

Run a single spec file

rspec spec/models/post_spec.rb

Run a single example from a spec file (by line number)

rspec spec/models/post_spec.rb:6

See all options for running specs

rspec --help