Skip to content

Instantly share code, notes, and snippets.

View flomotlik's full-sized avatar

Florian Motlik flomotlik

View GitHub Profile
require 'coveralls'
Coveralls.wear!
@flomotlik
flomotlik / coveralls_multiple.rb
Last active December 16, 2015 15:59
Getting Started with Coveralls
#Coveralls with Rspec and Cucumber
require 'coveralls'
Coveralls.wear_merged!
SimpleCov.merge_timeout 3600
#MAKING SURE SIMPLECOV WORKS WITH THE PARALLEL_TESTS GEM
SimpleCov.command_name "RSpec/Cucumber:#{Process.pid.to_s}#{ENV['TEST_ENV_NUMBER']}"
#!/bin/bash
heroku pgbackups:capture --expire --app YOUR_PRODUCTION_APP_NAME
heroku pgbackups:restore DATABASE `heroku pgbackups:url --app YOUR_PRODUCTION_APP` --app YOUR_STAGING_APP --confirm YOUR_STAGING_APP
@flomotlik
flomotlik / Gemfile
Created April 18, 2013 13:41
Heroku require
gem 'heroku', require: false
@flomotlik
flomotlik / Setup.sh
Last active December 16, 2015 07:39
Install postgres 9.2 and Postgis 2.0.x on Ubuntu
#!/bin/bash
#Postgres Repository
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
apt-get install postgresql-9.2 postgresql-contrib-9.2
#Install POSTGIS
apt-get install postgresql-server-dev-9.2 libgeos-dev libproj-dev libgdal-dev -y -q
#Run with casperjs test translate.coffee
casper.start 'http://translate.google.com/', ->
@.sendKeys('#source', 'Guten Tag');
@.then ->
@.click '#gt-submit'
@.waitForText('Good day')
@.then ->
@.test.assertSelectorHasText '#result_box', 'Good day'
@.then ->
#Run with casperjs test casperjstest.coffee
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)')
casper.start 'http://casperjs.org', ->
@.viewport(1024, 768);
@.thenClick('.dropdown-toggle')
@.then ->
@.clickLabel 'Tester API'
@.then ->
@.clickLabel 'Extending'
@flomotlik
flomotlik / codeshiptest.coffee
Last active December 14, 2015 14:49
Gist files for Casperjs Blogpost
#Run with casperjs test codeshiptest.coffee
casper.start 'https://www.codeship.io/', ->
@.clickLabel 'Blog', 'a'
@.then ->
@.test.assertUrlMatch 'http://blog.codeship.io'
casper.run ->
@.test.done(1)
Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, {js_errors:true, port:44678+ENV['TEST_ENV_NUMBER'].to_i, phantomjs_options:['--proxy-type=none'], timeout:180})
end
gem 'capybara'
require 'capybara/poltergeist'
Capybara.javascript_driver = :poltergeist