Skip to content

Instantly share code, notes, and snippets.

expected #<Subscription id: nil, plan_id: 2, user_id: nil, stripe_customer_token: nil, created_at: nil, updated_at: nil, status: nil, canceled_at: nil, period_end_at: nil>
got #<Subscription id: nil, plan_id: 2, user_id: nil, stripe_customer_token: nil, created_at: nil, updated_at: nil, status: nil, canceled_at: nil, period_end_at: nil>
require 'spec_helper'
describe SubscriptionsController do
context "Actions" do
before do
stub_out_user(controller, @user = Factory.stub(:user))
@plan = Factory(:plan)
@params = {}
end
$ rake -T
(in /Users/apraditya/Work/my_os_projects/rapi_doc)
rake aborted!
uninitialized constant Rake::DSL
/Users/apraditya/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/Users/apraditya/.rvm/gems/ruby-1.9.2-p180@rapidoc/gems/rake-0.9.2.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
/Users/apraditya/.rvm/gems/ruby-1.9.2-p180@rapidoc/gems/rake-0.9.2.2/lib/rake/tasklib.rb:6:in `<module:Rake>'
/Users/apraditya/.rvm/gems/ruby-1.9.2-p180@rapidoc/gems/rake-0.9.2.2/lib/rake/tasklib.rb:3:in `<top (required)>'
/Users/apraditya/.rvm/gems/ruby-1.9.2-p180@rapidoc/gems/jeweler-1.6.4/lib/jeweler/tasks.rb:2:in `require'
/Users/apraditya/.rvm/gems/ruby-1.9.2-p180@rapidoc/gems/jeweler-1.6.4/lib/jeweler/tasks.rb:2:in `<top (required)>'
@apraditya
apraditya / books_controller.rb
Created February 20, 2012 03:07
An example of how rapi_doc is setup
class BooksController < ApplicationController
# GET /books
# GET /books.json
#=begin apidoc
#url:: /books
#method:: GET
#access:: FREE
#return:: [JSON|XML] - list of book objects
#param:: page:int - the page, default is 1
#param:: per_page:int - max items per page, default is 10
Failure/Error: @rateable_object = Fabricate :script
AWS::S3::Errors::AccessDenied:
Access Denied
# (eval):3:in `create_bucket'
# ./spec/models/user_spec.rb:140:in `block (5 levels) in <top (required)>'
@apraditya
apraditya / users_factory.rb
Created May 25, 2012 04:40
factory definition
Factory.define :user do |u|
u.password 'password'
u.password_confirmation { |u| u.password }
u.confirmation_sent_at Time.new
u.confirmed_at Time.new
u.location 'US'
end
Factory.define :admin, :parent => :user do |admin|
admin.sequence(:name) { |n| "Admin #{n}" }
@apraditya
apraditya / Gemfile.lock
Created September 17, 2012 07:00
This email layout and sass files can be used to reproduce this issue https://github.com/Mange/roadie/issues/14
GIT
remote: git://github.com/radar/forem.git
revision: 515839e73bccbcb2f228e23082538bc86e7114fc
ref: 515839e73b
specs:
forem (1.0.0.beta1)
cancan
forem-redcarpet (= 1.0.0)
rails (~> 3.1)
simple_form
class User < ActiveRecord::Base
include OpengraphMethods
def opengraph_title
opengraph_site_name # doesn't create the meta entry
# These don't create as well
send(:opengraph_site_name)
send(:opengraph_site_name).to_s
'this one works'
module OpengraphMethods
def og_site_name
"the site name"
end
#def og_title
# opengraph_from_method [:title, :full_name], use_postfix: true
#end
def og_description
@apraditya
apraditya / facebook_test_user.rb
Created December 12, 2012 16:29
A simple ruby script to generate Facebook [Test Users](https://developers.facebook.com/docs/test_users/).
require 'open-uri'
require 'json'
app_id = 'YOUR_FACEBOOK_APP_ID'
app_secret = 'YOUR_FACEBOOK_APP_SECRET'
full_name = 'John Smith'
token_request_url = "https://graph.facebook.com/oauth/access_token?client_id=#{app_id}"
token_request_url += "&client_secret=#{app_secret}&grant_type=client_credentials"