Skip to content

bernardleanse/simple_blog

Repository files navigation

Process

Started off with a simple class diagram and entity relation model

Domain Model

Now to setup rakefile and database for development and test

Rake setup to create and drop the test and dev databases, and run migration for simple version of post table. Each step manually tested then committed.

Test drove creating posts viewing posts and editing posts using capybara to mimick a web browser interface, writing class methods that didn't yet exist(code I wish I had), to then test drive these class methods with integration or unit tests which would commit to the test database as the spec helper sets the environment and when the app.rb is required, the DatabaseConnection class instance variable @connection connects to the test, so whenever any query in this application is done, it will choose the correct database depending if it's a me in the browser, or capybara doing it through rspec.

Throughout I foucssed on small incremental changes and commits where possible, and only writing code when there is a failing test!

Coming Soon

Comments, styling update and hash tags.

How to use

Make sure you have ruby 3.0.2 and you have installed PostgreSQL.

  gem install bundler
  bundle install
  rake create_databases
  rake migrate
  rackup

Then vist http://localhost:9292/posts

About

creating simple blog site in ruby with test driven focus

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors