Skip to content

Instantly share code, notes, and snippets.

@trendwithin
trendwithin / devise_confirmable_capybara_test.md
Created March 22, 2016 20:12
Devise Confirmable Capybara Test
scenario 'HP: User Sign Up w/ Confirmable Email and Log in ' do
  visit new_user_registration_path
  fill_in 'Email', with: 'test_user_confirmable@example.com'
  fill_in 'Password', with: 'password'
  fill_in 'Password confirmation', with: 'password'
  assert_difference 'User.count', 1 do
    click_button 'Sign up'
    mail = ActionMailer::Base.deliveries[0]
    token = mail.body.decoded.match(/confirmation_token=([^"]+)/)[1]

assert_equal User.find_by(email: "test_user_confirmable@example.com").confirmation_token, token

Angular Haiku:
Module: A definition / Container Sailing Away? / Controll and Contained
Scope: A magical glue / Straight forward inheritance / Unless isolated
Directive: Readability / functions telling a story / Through HTML extension
Controller: Constructor function / What's your junction? Business Logic / Through Scoping Objects