Skip to content

Instantly share code, notes, and snippets.

View prolificcoder's full-sized avatar

Satyajit Malugu prolificcoder

  • SoFi
  • Raleigh
View GitHub Profile
@beresmate
beresmate / parallel-test-task.js
Last active May 12, 2016 18:17
Run mocha processes parallel from a Grunt task.
module.exports = function (grunt) {
// collect the test files from our test folder
// for example grunt.file.expand
function getTests () {
var tests = [
{
filePath: '/Users/Mate/Desktop/LoginTest.js',
name: 'Login test'
},
{
@sbeam
sbeam / gist:3849340
Created October 7, 2012 19:39
capybara helper for select2-ajax elements
# select2_ajax helper to make capybara work with ajax-enabled Select2 elements
# assumes 'placeholder' option is used in Select2 (if it is using ajax, it should be)
#
# usage:
#
# it "should have a select2 field for searching by team name" do
# @team = Factory :team
# select2_ajax @team.name, :from => "Select a Team", :minlength => 4
# click_button "Join"
# page.should have_content "You are now on '#{@team.name}'."
@metaskills
metaskills / wait_until.rb
Last active May 2, 2024 01:51
Never sleep() using Capybara!
# WAIT! Do consider that `wait` may not be needed. This article describes
# that reasoning. Please read it and make informed decisions.
# https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/
# Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations?
describe 'Modal' do
should 'display login errors' do
visit root_path
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')