Skip to content

Instantly share code, notes, and snippets.

class PostImage < ActiveRecord::Base
# So we can code post_image.category instead of the uglier post_image.post_image_category
belongs_to :category, :class_name => 'PostImageCategory', :foreign_key => 'post_image_category_id'
# You may want to pass other options to has_attachment.
# See the attachment_fu README.
has_attachment :content_type => :image,
:storage => :file_system,
# There is no size restriction on thumbnails.
# But you'll probably want them to fit in the TinyMCE plugin popup dialog.
require File.dirname(__FILE__) + '/../test_helper'
class EditorActionsTest < ActionController::IntegrationTest
# CNK not sure if we are going to use fixtures
# I would prefer to use factories but am having trouble with that
# fixtures :users, :roles, :roles_users, :pages
def setup
@home_page = Factory.create_home_page
@editor = Factory.create_user_with_role('editor', :login => 'abenter', :email => 'abenter@caltech.edu', :password => 'abenter', :password_confirmation => 'abenter')
require "selenium"
require "test/unit"
class NewTest < Test::Unit::TestCase
def setup
@verification_errors = []
if $selenium
@selenium = $selenium
else
@selenium = Selenium::SeleniumDriver.new("localhost", 4444, "*chrome", "http://www.google.com/", 10000);
<!--
Attempt to build a TaskPaper theme similar to TextMate Twilight theme.
TODO:
* Make tags smaller. There are some things I added for 'tag' but not being applied to tags just yet.
* Would like @next_action to be visually differentiated, then when the task is complete, have it look like a normal @done task and remove the @next_action tag. See http://groups.google.com/group/taskpaper/browse_thread/thread/8c413a8d73fecf9a for some tips that might help.
-->
<theme>
<!-- Window Style -->
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
class ApplicationController < ActionController::Base
# SUPER DARING APP TEMPLATE 1.0
# By Peter Cooper
# Link to local copy of edge rails
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' }
# Delete unnecessary files
run "rm README"
run "rm public/index.html"
run "rm public/favicon.ico"
require 'test_helper'
class MyHelperTest < ActionView::TestCase
test "title" do
assert_select_in '<h1>My Awesome App</h1>', 'h1'
end
test "nav" do
html = '<div id="nav"><a href="/">Home</a></div>'
assert_select_in html, 'div' do