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
require 'spec_helper' | |
describe "blog/shared/_post.html.erb" do | |
let (:post) do | |
stub_model(BlogPost, | |
:title => "Blog", | |
:published_at => Time.now | |
) | |
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
create | |
create README | |
create Rakefile | |
create config.ru | |
create .gitignore | |
create Gemfile | |
create app | |
create app/assets/images/rails.png | |
create app/assets/javascripts/application.js | |
create app/assets/stylesheets/application.css |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" /> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<!-- iPad/iPhone specific css below, add after your main css > | |
<link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="ipad.css" type="text/css" /> | |
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css" type="text/css" /> |
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
# This file is copied to spec/ when you run 'rails generate rspec:install' | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path("../../config/environment", __FILE__) | |
require 'rspec/rails' | |
##Clean up the database | |
require 'database_cleaner' | |
require 'capybara/rspec' | |
# Requires supporting ruby files with custom matchers and macros, etc, | |
# in spec/support/ and its subdirectories. |
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 OccasionsController < InheritedResources::Base | |
belongs_to :event | |
actions :all, :except => [:show, :index] | |
# Need to override this from inherited_resources | |
# to scope the association chain to the current_user | |
def begin_of_association_chain | |
current_user | |
end | |
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
Error: | |
test: Given new Kyck by non-fan and kycker Tags a Team to Kyck and a second Kyck by non-fan with this team tagged to the Kyck should generate User-Tag score increment for non-fan kycker. (UserRelevanceCalculatorTest): | |
ArgumentError: wrong number of arguments (2 for 1) | |
/Users/ggoodrich/.rvm/gems/ruby-1.9.2-p290@kyck/gems/mocha-0.10.0/lib/mocha/object.rb:90:in `stubs' | |
/Users/ggoodrich/rb/rails_apps/kyck/Web/test/unit/top_kyck/user_relevance_calculator_test.rb:23:in `block (3 levels) in <class:UserRelevanceCalculatorTest>' | |
/Users/ggoodrich/.rvm/gems/ruby-1.9.2-p290@kyck/gems/shoulda-2.11.3/lib/shoulda/context.rb:400:in `call' | |
/Users/ggoodrich/.rvm/gems/ruby-1.9.2-p290@kyck/gems/shoulda-2.11.3/lib/shoulda/context.rb:400:in `block in run_current_setup_blocks' | |
/Users/ggoodrich/.rvm/gems/ruby-1.9.2-p290@kyck/gems/shoulda-2.11.3/lib/shoulda/context.rb:399:in `each' | |
/Users/ggoodrich/.rvm/gems/ruby-1.9.2-p290@kyck/gems/shoulda-2.11.3/lib/shoulda/context.rb:399:in `run_current_setup_blocks |
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
15) Error: | |
test: Given 3 days of Kycks when the scorer has never been run before should generate scores for Kycks within the past 2 days. (ScorerTest): | |
Mocha::ExpectationError: unexpected invocation: #<Object:0x104727d38>.publish('channel' => '/users/NcqqRNBRmUZwua1x68JS/notifications', 'message' => {'id' => 1, 'unread' => true, 'kind' => 'post_commented', 'text' => 'John Doe121 has commented on your KYCK', 'partialText' => 'has commented on your KYCK', 'objID' => 1, 'objType' => 'Post', 'objAlias' => nil, 'createdAt' => '2012-01-09T00:00:00Z', 'previewURL' => nil, 'previewRatio' => nil, 'initiator' => {'id' => 1, 'firstName' => 'John', 'lastName' => 'Doe121', 'avatarURL' => 'http://192.168.1.143:3000/assets/default_avatar.gif', 'alias' => nil, 'followedByCurrentUser' => false}}) | |
unsatisfied expectations: | |
- expected exactly once, not yet invoked: Event(id: integer, name: string, starting_at: datetime, icon: string, icon_ratio: float, checkins_count: integer, posts_count: integer, created_at: datetime, update |
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
require 'goliath' | |
class ApiValidationAroundware | |
include Goliath::Rack::SimpleAroundware | |
class InvalidApiKeyError < Goliath::Validation::BadRequestError; end | |
def pre_process | |
validate_api_key! | |
env.logger.info "past api_key validation" #<-- this is output, then an empty response header & body as if it is just hanging... | |
Goliath::Connection::AsyncResponse |
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
var Tag = Model.subclass(function (data) { | |
//HACK | |
if (data.owner !== null){ | |
this.mapping = { | |
owner: Model.mapping.object(data.ownerType) | |
} | |
if (data.owner.__ko_mapping__) { | |
data.owner = ko.mapping.toJS(data.owner); | |
} |