Skip to content

Instantly share code, notes, and snippets.

@stevenwilkin
Created April 22, 2015 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stevenwilkin/8095b3d5b923c55d1aec to your computer and use it in GitHub Desktop.
Save stevenwilkin/8095b3d5b923c55d1aec to your computer and use it in GitHub Desktop.
Smoke test output document generator
source 'https://rubygems.org'
ruby '2.2.2'
gem 'mechanize'
#!/usr/bin/env ruby
require 'bundler/setup'
require 'mechanize'
domain = 'http://localhost:3000'
email = 'email'
password = 'password'
mech = Mechanize.new
page = mech.get(domain)
if page.body !~ /Log in/
raise '> should render login form'
end
form = page.forms.first
form['user[email]'] = email
form['user[password]'] = password
page = form.submit(form.buttons.first)
if page.body !~ /issue a personalised record of guidance/
raise '> should be logged in'
end
puts '> ok'
@gjvis
Copy link

gjvis commented Apr 22, 2015

About 10_000 times better than what we currently have!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment