Created
April 22, 2015 16:13
-
-
Save stevenwilkin/8095b3d5b923c55d1aec to your computer and use it in GitHub Desktop.
Smoke test output document generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
ruby '2.2.2' | |
gem 'mechanize' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
About 10_000 times better than what we currently have!