Skip to content

Instantly share code, notes, and snippets.

require 'spec_helper'
describe StyleParser do
describe "given properly formatted input" do
it "should set and return variables properly" do
text = %{// @name Masthead Background Image
// @kind file
// @description Background image.
$mbc2: "http://someurl.com/image.jpg";
class Style < ActiveRecord::Base
...
def duplicate!(user, *args)
options = args.extract_options!
site ||= options[:site]
dup_style = self.class.create :site_id => site, :name => name, :user_id => user.id
self.file_attachments.each { |file_attachment| file_attachment.duplicate!(dup_style) }
self.images.each { |image| image.duplicate!(dup_style) }
dup_style
end
class SiteStyle < ActiveRecord::Base
belongs_to :site
belongs_to :user
validates_presence_of :name, :user
has_many :images, :as => :imageable, :order => "position", :dependent => :destroy
...
def duplicate!(user, *args)
options = args.extract_options!
cd /var/www/amplify/current && /home/ramon/.rvm/bin/rvm use ree-1.8.7@rails3 && RAILS_ENV=production /home/ramon/.rvm/gems/ree-1.8.7-2010.02@rails3/bin/rake backup &>/home/ramon/backup.log &>/home/ramon/backup.log
class OverridableList < SimpleNavigation::Renderer::Base
def render(item_container)
list_content = item_container.items.inject([]) do |list, item|
if item.html_options[:link] && item.html_options[:link].is_a?(String) # so we can still pass link options
li_content = item.html_options[:link]
else
li_content = link_to(item.name, item.url, link_options_for(item))
end
class PagesDrop < Liquid::Drop
def initialize(pages)
# the arg passed in should always be an AR Relation (AREL)
@pages = pages
end
def group_by
GroupByDrop.new(@pages)
end
class PageDrop < Liquid::Drop
include ActionView::Helpers::AssetTagHelper
include Rails.application.routes.url_helpers
include AlbumsHelper
include ImagesHelper
def initialize(page)
@page = page
end
Failures:
1) SimpleNavigation::Adapters::Rails self.register should call set_env
Failure/Error: SimpleNavigation.register
uninitialized constant Sinatra
# ./spec/../lib/simple_navigation/adapters/sinatra.rb:55:in `sinatra_root'
# ./spec/../lib/simple_navigation/adapters/sinatra.rb:8:in `register'
# ./spec/lib/simple_navigation/adapters/rails_spec.rb:24
2) SimpleNavigation::Adapters::Rails self.register should extend the ActionController::Base with the Helpers
Failure/Error: SimpleNavigation.register
aasm (2.2.0)
abstract (1.0.0)
actionmailer (3.0.5)
actionpack (3.0.5)
activemodel (3.0.5)
activerecord (3.0.5)
activeresource (3.0.5)
activesupport (3.0.5)
acts_as_list (0.1.2)
akephalos (0.2.5)
@font-face {
font-family: "Lucida Type";
src: url("/media/BAhbBlsHOgZmIiYyMDExLzAzLzA5LzA5LzUwLzIzLzg2Ny9MVFlQRS5UVEY/LTYPE.TTF?s=212bd7e4");
}
@font-face {
font-family: "Lucida Type Oblique";
src: url("/media/BAhbBlsHOgZmIicyMDExLzAzLzA5LzA5LzUwLzI1LzYyOS9MVFlQRU8uVFRG/LTYPEO.TTF?s=681b120d ");
}