Skip to content

Instantly share code, notes, and snippets.

# Adapted for Rspec2. This won't work in RSpec 1.
# Updated with new syntax to remove deprecation warnings
# Put this code in acceptance_helper.rb or better in a new file spec/acceptance/support/javascript.rb
RSpec.configure do |config|
config.before(:each) do
Capybara.current_driver = Capybara.javascript_driver if example.metadata[:js]
end
@ThroughTheNet
ThroughTheNet / unicorn.config.dev.rb
Created June 14, 2011 13:34 — forked from namelessjon/unicorn.config.dev.rb
Simple-ish reloading of the important parts of an app on changes
# Sample configuration file for Unicorn (not Rack)
worker_processes 1
# listen on the sinatra port
listen 4567
# feel free to point this anywhere accessible on the filesystem
pid "#{ENV['XDG_CACHE_HOME']}/unicorn.pid"
stdout_path "#{ENV['XDG_CACHE_HOME']}/unicorn.log"
def order_subtotal(order, options={})
options.assert_valid_keys(:format_as_currency, :show_vat_text)
options.reverse_merge! :format_as_currency => true, :show_vat_text => true
amount = order.total
out = options.delete(:format_as_currency) ? number_to_currency(amount) : amount
content_tag(:span, out, :class => "foo")
end