This file contains hidden or 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
// Mixins --------------------------------------------------------------- | |
=placeholder | |
&::-webkit-input-placeholder | |
@children | |
&:-moz-placeholder | |
@children | |
&.placeholder | |
@children |
This file contains hidden or 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
My culerity/cucumber tests were running at 30 minutes, now just six. JRuby was limiting the allocated memory to 512mb (or something). I increased this to a gigabyte and now everything flies: | |
>> JRUBY_INVOCATION="jruby -J-Xmx1024m" cucumber | |
More Info: | |
http://viralpatel.net/blogs/2009/01/jvm-java-increase-heap-size-setting-heap-size-jvm-heap.html |
This file contains hidden or 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
#in my spec helper | |
def expose(name, &block) | |
exhibitionist = Module.new | |
exhibitionist.send(:define_method, name, &block) | |
view.extend exhibitionist | |
end | |
# in my view spec | |
describe "dashboard/index.html.haml" do | |
it 'renders' do |
This file contains hidden or 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
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
This file contains hidden or 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 hidden or 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
# This module should be used for situations where enumerating over constant values is desired. | |
# This facilitates keeping the code DRY by keeping the constant values defined in one place, and | |
# still having the ability to enumerate over them wherever they are needed. | |
# | |
# Example use cases: | |
# | |
# * defining constants for possible field values in an AR object and including this module to | |
# provide access to the values in a 'validates_inclusion_of' validation | |
# * defining constants for select box values in a view and including this module to allow them to be | |
# enumerated over in the select tag |
This file contains hidden or 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
require 'bunny' # Change this to point to the test version of bunny.rb otherwise you will probably be asking for the gem | |
require 'timeout' | |
b = Bunny.new(:logging => true, :heartbeat => 30) # Set heartbeat to 30 seconds | |
# Create a new heartbeat frame | |
hb = Qrack::Transport::Heartbeat.new() | |
b.start |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder