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
#!/bin/bash | |
# /etc/init.d/xvfb_daemon | |
# Xvfb startup script. | |
# Tom Meier <[email protected]> | |
# | |
### BEGIN INIT INFO | |
# Provides: xvfb | |
# Short-Description: Start/stop/restart daemon | |
# Description: Controls the Xvfb daemon which starts/stops the X Virtual Framebuffer server | |
### END INIT INFO |
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
# 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 | |
click_link 'My HomeMarks' | |
within '#login_area' do | |
fill_in 'email', with: '[email protected]' | |
fill_in 'password', with: '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
module ActiveRecord | |
class Base | |
class << self | |
def default_scope(options = {}) | |
reset_scoped_methods | |
default_scoping = self.default_scoping.dup | |
previous = default_scoping.pop | |
if previous.respond_to?(:call) or options.respond_to?(:call) |
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 pending_total | |
if not_needed? | |
0.00 | |
else | |
# everyone gets the member pricing | |
daily_rate = ACCOMMODATION_RATES[room_type][:member] | |
departure_date = departure.to_date | |
arrival_date = arrival.to_date | |
total_days = departure_date - arrival_date | |
before_discounted_days = [[start_date - arrival_date, 3].min, 0].max |
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
# for testing validates_length_of :name, :within => 3..100, :allow_nil => true | |
it "should not be valid with a name having less than 3 or more than 100 characters, if name is given" do | |
@category = Category.new @valid_attributes | |
@category.name = 'to' | |
@category.should have(1).errors_on(:name) | |
@category.errors.on(:name).should include "too short" | |
@category = Category.new @valid_attributes | |
@category.name = 't'*101 | |
@category.should have(1).errors_on(:name) | |
@category.errors.on(:name).should include "too long" |