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
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' | |
}, | |
{ |
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
# 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}'." |
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
# 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 |
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
=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') |