Skip to content

Instantly share code, notes, and snippets.

{
"_id" : "1_522311",
"chr" : "1",
"pos" : 522311,
"groups" :
[{
"_id" : "12345",
"label" : "group1",
"capabilities" : [{"name" : "value"}, {"name2": "value2"}]
},
<!-- INCLUDE overall_header.html -->
<!-- IF S_FORUM_RULES -->
<div class="forumrules">
<!-- IF U_FORUM_RULES -->
<h3>{L_FORUM_RULES}</h3><br />
<a href="{U_FORUM_RULES}"><b>{L_FORUM_RULES_LINK}</b></a>
<!-- ELSE -->
<h3>{L_FORUM_RULES}</h3><br />
{FORUM_RULES}
var sys = require('sys'),
irc = require('./vendor/irc');
// The bot is a very thin wrapper around our IRC
// mobile. Instaniate the bot and then call
// ``connect()`` when you're ready to go.
// Send messages to IRC with the .send(channel, msg)
// method.
//
// You can do standard IRC commands through the
var sys = require("sys"),
utils = require("utils"),
tcp = require("tcp");
/**
* The Interpret object is just a namespace for the various interpreter
* functions such as textToIrc and ircToText.
*/
this.Interpret = {
/**
kurt@kurtix:~/Documents/Projects/hector$ rake
(in /home/kurt/Documents/Projects/hector)
/usr/bin/ruby1.8 -I"lib:test" "/usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/session_test.rb" "test/unit/identity_test.rb" "test/unit/request_test.rb" "test/unit/irc_error_test.rb" "test/integration/messaging_test.rb" "test/integration/connection_test.rb"
Loaded suite /usr/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
EEEEEEEEE..........EE.....EEEFEE
Finished in 0.025307 seconds.
1) Error:
test :"connecting with a valid password should create a session"(Hector::ConnectionTest):
diff --git a/spec/unit/mongoid/dirty_spec.rb b/spec/unit/mongoid/dirty_spec.rb
index e412abc..43103c9 100644
--- a/spec/unit/mongoid/dirty_spec.rb
+++ b/spec/unit/mongoid/dirty_spec.rb
@@ -45,6 +45,18 @@ describe Mongoid::Dirty do
end
end
+ context "when the attribute is mutated in place" do
+ before do
def transfer_credits_to(target, amount, message = nil)
debit = Credit.new(:amount => amount * -1, :message => message)
debit.source = target
debit_params = {"_id" => self.id, "credits_amount_sum" => {'$gte' => amount}}
debit_attrs = {
'$push' =>
{'credits' => debit.raw_attributes},
'$inc' =>
{'credits_amount_sum' => debit.amount}
irb(main):030:0> s = Story.new
=> #<Story _id: 4bc8761e8f80a9282c000004, slug: nil, credits_amount_sum: 0, title: nil, proposal_id: nil>
irb(main):031:0> s.save
=> true
irb(main):032:0> s.id
=> "4bc8761e8f80a9282c000004"
> db.stories.findOne('4bc8761e8f80a9282c000004')
{
#adds tags where categories don't match up
if data.has_key?('categories')
tags = data['tags'] || []
placement_tags = []
data['categories'].values.map{|c| c.split('/')}.flatten.each do |cat|
unless cat.empty? || tags.include?(cat) || placement_tags.include?(cat)
cat = '@' + cat
placement_tags << cat unless tags.include?(cat) || placement_tags.include?(cat)
end
require 'spec_helper'
describe OauthController do
before(:all) do
@consumer = Factory.create(:oauth_consumer)
end
context 'serving an xauth token request to a valid consumer' do
before(:all) do
@user = Factory.create(:user)