Skip to content

Instantly share code, notes, and snippets.

View tgaff's full-sized avatar

tgaff tgaff

View GitHub Profile
@tgaff
tgaff / site-prism.md
Last active December 14, 2022 21:40 — forked from h-parekh/site-prism.md
What, why and a little bit of how to use site-prism

site prism

Page Object Model gem for ruby Page Objects are like react-components for integration spec code. They let you componentize pages or parts of pages so you don't use css-selectors every where.

If you have page.find('button', text: 'update section') in a lot of tests, when the PM says it should be 'Change Section' you have a lot of changes to make.
By sticking this in the page-object it limits the needed scope of change to just that POM and possible the one test that regression checked this.

pages

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@tgaff
tgaff / authentication_with_bcrypt_in_rails_4.md
Last active March 11, 2023 02:21 — forked from eerwitt/authentication_with_bcrypt_in_rails_4.md
Simple Authentication in Rail 4 Using Bcrypt

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps