Skip to content

Instantly share code, notes, and snippets.

View henrypoydar's full-sized avatar
🤓

Henry Poydar henrypoydar

🤓
View GitHub Profile
@henrypoydar
henrypoydar / haml_coverage_spec.rb
Created December 29, 2008 16:20
A spec to make sure all view and partial template have specs
require File.dirname(__FILE__) + '/../spec_helper'
require 'find'
describe 'View template spec coverage' do
# Because the application is using Haml for all
# view and partial templates, a typo or indentation
# mistake in these templates will likely raise
# an exception. So in addition to integrated controller
# specs and existing view specs, it's important that
# get the user record for which you'd like to import
tom = User.first
everyone_view = [{'user_group_id' => tom.account.user_groups.everyone.id}].map {|group| [group['user_group_id'], 'default']}
# create the import, pointing to the csv
UserActionLogger.log_actions_with(tom) { $i = Import.create(:views => everyone_view, :user => tom, :source => File.open("/Users/danferranti/Desktop/Tuckerbrook-test.csv"), :state => 'preparing') }
# check that the headers map properly
$i.map_header
1)
ActionView::TemplateError in 'UserMailer notifications for specific events should send an email when creating an event'
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.full_name
On line #13 of app/views/user_mailer/notification-event-sent.text.plain.erb
10: <% end %>
11: <% unless @document.attendees.empty? %>
12: Invitees: <% @document.attendees.each do |attendee| %>
13: <%= attendee.full_name %>
function queryObject() {
var pairs, pair;
var query = new Array;
pairs = document.location.search.slice(1).split('&');
for(var i = 0; i < pairs.length; i++) {
pair = pairs[i].split('=');
query[pair[0]] = pair[1];
}
return query;
}
// Code from processing-js that's failing in webkit only, FF runs it fine
function buildProcessing( curElement ){
// ...
var p = {};
p.import = function import(lib) {
//...
}
# AR model callback that uses paperclip and tempfile
def generate_previews
dimension_multiplier = case units
when 'inches'; 30
else; 30
end
#!/usr/bin/ruby
#
# Simple deploy recipe to wrap up the moving parts
# of couchapp pushing based on .couchapprc settings,
# sprockets concatenation, jsmin compression and
# cssmin compression
#
require 'rubygems'
DEBUG: Using local file for template:/tmp/chef-solo_test/cookbooks/testbook/templates/default/somservice.conf.erb
ERROR: template[/root/someservice.conf] (/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/recipe.rb line 189) had an error:
different prefix: "/" and "."
/usr/lib/ruby/1.8/pathname.rb:709:in `relative_path_from'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/provider/template.rb:56:in `action_create'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/runner.rb:87:in `send'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/runner.rb:87:in `converge'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/runner.rb:85:in `each'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/runner.rb:85:in `converge'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/resource_collection.rb:58:in `each'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/resource_collection.rb:57:in `each'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/runner.rb:63:in `converge'/usr/lib/ruby/gems/1.8/gems/chef-0.7.0/lib/chef/client.rb:373:in `converge'/usr/li
common: &default_settings
license_key: 'xxx'
app_name: crm-core
enabled: false
log_level: info
ssl: false
apdex_t: 0.5
capture_params: false
// PROBLEM:
// A Sammy app
// Current code with nested view queries:
get('#/renderings', function() {
var ctx = this;
couchapp.design.view("renderings", {
include_docs: true,
success: function(jsona) {