This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'Comment model', -> | |
beforeEach -> | |
@xhr = sinon.useFakeXMLHttpRequest() | |
@requests = [] | |
@xhr.onCreate = (xhr) => | |
@requests.push xhr | |
interaxt.comments = new interaxt.models.Comments() | |
afterEach -> | |
@xhr.restore | |
describe 'when the user is a PUBLISHER', -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'Comment model', -> | |
beforeEach -> | |
interaxt.SHOW_HOST = 'testhost' | |
@xhr = sinon.useFakeXMLHttpRequest() | |
@requests = [] | |
@xhr.onCreate = (xhr) => | |
@requests.push xhr | |
afterEach -> | |
@xhr.restore | |
describe 'when the user is a PUBLISHER', -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Error: Invalid element to decorate | |
at Error (unknown source) | |
at [object Object].decorate (http://localhost:3000/assets/closure/goog/ui/component.js:705:11) | |
at new <anonymous> (http://localhost:3000/assets/closure/comment.js:277:15) | |
at [object Object].create (http://localhost:3000/assets/closure/main.js:24:24) | |
at http://localhost:3000/assets/closure/ozz.js:141:5 | |
at [object Object].<anonymous> (http://localhost:3000/assets/closure/ozz.js:577:7) | |
at [object Object].handleComplete_ (http://localhost:3000/assets/closure/goog/net/xhrmanager.js:362:46) | |
at [object Object].handleEvent_ (http://localhost:3000/assets/closure/goog/net/xhrmanager.js:289:19) | |
at [object Object].<anonymous> (native) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interaxt.container.createComment 'the commment' | |
@result = interaxt.app.showEvent.collection$Values(20).forEach( | |
(comment) => | |
if comment.getBody == 'the commment' | |
return true | |
) | |
expect(interaxt.can).toHaveBeenCalled() | |
expect(@result).toBeTruthy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"show_event": { | |
"host": "pyotr_k", | |
"role": 100, | |
"key": 531412, | |
"token": "T1==cGFydG5lcl9pZD01MzE0MTImc2RrX3ZlcnNpb249dGJydWJ5LXRicmItdjAuOTEuMjAxMS0wNy0wNSZzaWc9OWNjYzFlMWVmOGFiN2E2MTczMjM0ZDgyNmQzYzc0NDRlZTQxYzBjOTpyb2xlPW1vZGVyYXRvciZzZXNzaW9uX2lkPTJfTVg0MU16RTBNVEotTVRJM0xqQXVNQzR4ZmpJd01USXRNRE10TVRRZ01USTZNRGc2TkRNdU1UazJNek16S3pBd09qQXdmakF1TmpZME16UXdPVFF5TWpNNWZnJmNyZWF0ZV90aW1lPTEzMzE3MzM3NzMmbm9uY2U9MC4wNjYxODI4MzkzODYwMjQ4NyZjb25uZWN0aW9uX2RhdGE9JTdCJTIycm9sZSUyMiUzQTEwMCUyQyUyMnBpZCUyMiUzQSUyMnB5b3RyX2slMjIlN0Q=", | |
"session_id": "2_MX41MzE0MTJ-MTI3LjAuMC4xfjIwMTItMDMtMTQgMTI6MDg6NDMuMTk2MzMzKzAwOjAwfjAuNjY0MzQwOTQyMjM5fg", | |
"poster": { | |
"updated_at": 1331726923 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AvailabilityController < ApplicationController | |
before_filter :set_current_customer | |
before_filter :update_customer_status | |
def statuses | |
statuses_collection = @current_customer.collect_statuses | |
render :json => { | |
:partnerStatuses => statuses_collection, | |
} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Identity < ActiveRecord::Base | |
belongs_to :user | |
has_one :settings | |
has_many :text_notifiers | |
has_many :mail_notifiers | |
has_many :favorites | |
has_many :saved_searches | |
has_many :utterances, :foreign_key => :author_id | |
has_many :claims do | |
def active |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Aplication Controller | |
before_filter :define_current_user | |
def define_current_user | |
User.current_user = current_user | |
end | |
#User.rb (model) | |
class User | |
class << self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/grape.rb | |
module AppstackGrapeEndpointSetup | |
extend ActiveSupport::Concern | |
module ClassMethods | |
include Rails.application.routes.url_helpers | |
def default_url_options | |
{host: ::Rails.application.config.action_mailer.default_url_options[:host]} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
counter = 0 | |
a = [0, 1, 2, 5, 10, 25, 50] | |
7.times do | i1 | | |
7.times do | i2 | | |
7.times do | i3 | | |
7.times do | i4 | | |
7.times do | i5 | | |
7.times do | i6 | | |
7.times do | i7 | | |
7.times do | i8 | |
OlderNewer