Skip to content

Instantly share code, notes, and snippets.

View indirect's full-sized avatar

André Arko indirect

View GitHub Profile
@eventualbuddha
eventualbuddha / seed_file.rb
Created July 9, 2010 01:51
SeedFile, a helper for doing database setup in a Rails 3 app
# Helper class for importing files with records to the database.
class SeedFile
def self.import(path)
new(path).import
end
attr_reader :path
def initialize(path)
@path = Pathname(path)
require File.expand_path('../../spec_helper', File.dirname(__FILE__))
describe Admin::ForumsController do
describe 'routing' do
# controller only implements #index, #show and #update
specify { get('/admin/forums').should have_routing('admin/forums#index') }
specify { get('/admin/forums/foo').should have_routing('admin/forums#show', :id => 'foo') }
specify { put('/admin/forums/foo').should have_routing('admin/forums#update', :id => 'foo') }
# the remaining RESTful actions aren't recognized
var setTextMeasure = function (contentElement, targetMeasure, maxSize, minSize) {
if (!contentElement) contentElement = document.createElement('p');
if (!targetMeasure) targetMeasure = 66;
if (!maxSize) maxSize = 16;
if (!minSize) minSize = 9;
var sizer = contentElement.cloneNode();
sizer.style.cssText = 'margin: 0; padding: 0; color: transparent; background-color: transparent; position: absolute;';