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') |
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
// | |
// Regular Expression for URL validation | |
// | |
// Author: Diego Perini | |
// Created: 2010/12/05 | |
// Updated: 2018/09/12 | |
// License: MIT | |
// | |
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it) | |
// |
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
gem 'pg' | |
group :development do | |
gem 'ruby-debug' | |
end | |
gem 'rake', '~> 0.8.7' | |
gem 'devise' | |
gem 'oa-oauth', :require => 'omniauth/oauth' | |
gem 'omniauth' | |
gem 'haml' | |
gem 'dynamic_form' |
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
sphinx: bundle exec rake ts:run_in_foreground |
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
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
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
# | |
# Recurring Job using Delayed::Job | |
# | |
# Setup Your job the "plain-old" DJ (perform) way, include this module | |
# and Your handler will re-schedule itself every time it succeeds. | |
# | |
# Sample : | |
# | |
# class MyJob | |
# include Delayed::ScheduledJob |
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
def screen_shot_and_save_page | |
require 'capybara/util/save_and_open_page' | |
path = "/#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}" | |
Capybara.save_page body, "#{path}.html" | |
page.driver.render Rails.root.join "#{Capybara.save_and_open_page_path}" "#{path}.png" | |
end | |
begin | |
After do |scenario| | |
screen_shot_and_save_page if scenario.failed? |
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
doctype html | |
/[if lt IE 7] | |
| <html class="ie6"> | |
/[if IE 7] | |
| <html class="ie7"> | |
/[if IE 8] | |
| <html class="ie8"> | |
/[if IE 9] | |
| <html class="ie9"> | |
| <!--[if (gte IE 9)|!(IE)]<!--> <html> <!--<![endif]--> |
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
# app/models/ability.rb | |
# All front end users are authorized using this class | |
class Ability | |
include CanCan::Ability | |
def initialize(user) | |
user ||= User.new | |
can :read, :all |
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
// basic structure of a Google+ Hangout application | |
(function () { | |
// setup UI elements for the G+ Hangout gadget/app | |
function setupFormHandler() { | |
var moodForm = $('#mood-form'); | |
moodForm.submit(onMoodFormSubmit); | |
} | |
function onMoodFormSubmit(evt) { |
OlderNewer