Skip to content

Instantly share code, notes, and snippets.

View plicjo's full-sized avatar

Joshua Plicque plicjo

View GitHub Profile
@jsborjesson
jsborjesson / register_statistics.rake
Created April 14, 2014 09:46
Add more folders to rake stats
task :register_statistics do
require 'rails/code_statistics'
STATS_DIRECTORIES << ['Services', 'app/services']
STATS_DIRECTORIES << ['Services Tests', 'test/services']
CodeStatistics::TEST_TYPES << 'Services Tests'
end
Rake::Task['stats'].enhance [:register_statistics]
@masarakki
masarakki / sample_of_alias_class_method.rb
Created December 2, 2010 08:28
HOW TO alias class method in ruby
class BaseClass
def self.find
"find"
end
end
# in class definition
class ClassA < BaseClass
def self.find_with_my_name
find_without_my_name + " ClassA"
@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')