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
POST /spackle1/api/people/? HTTP/1.1 | |
Connection: close | |
Content-Type: application/json | |
Cookie: | |
Content-Length: 152 | |
Host: localhost:8000 | |
{"request":{"email":"[email protected]","password":"abc123","username":"zach1","uuid":"123456789","schoolID":1,"first_name":"Zach","last_name":"Dennis"}} | |
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
url = "http://localhost:8000/spackle1/api/studentprojects/d0d84e45657d4841b504db75a196d708/tasks/6999dc92dee6485980a59c8b9c74e4e7/submissions/" | |
body = { | |
:url => "http://test/url", | |
:content => "description test ABC123" | |
} | |
a = Net::HTTP.post_form URI.parse(url), :request => body.to_json, :headers => { "Content-Type" => "application/json" } |
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
The error occurred while evaluating nil.each> | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:192:in `initialize' | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:15:in `new' | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:15:in `call' | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in `call' | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61:in `process' | |
/Users/jhwang/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client' | |
/Users/jhwang/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each' | |
/Users/jhwang/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client' | |
/Users/jhwang/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' |
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
The error occurred while evaluating nil.each> | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/utils.rb:192:in `initialize' | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:15:in `new' | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/content_length.rb:15:in `call' | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/chunked.rb:15:in `call' | |
/Library/Ruby/Gems/1.8/gems/rack-1.0.0/lib/rack/handler/mongrel.rb:61:in `process' | |
/Users/jhwang/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in `process_client' | |
/Users/jhwang/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each' | |
/Users/jhwang/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `process_client' | |
/Users/jhwang/.gem/ruby/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run' |
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
POST /spackle1/api/studentprojects/e43f85a96b36413b802c1792b893dea8/tasks/6999dc92dee6485980a59c8b9c74e4e7/submissions/ HTTP/1.1 | |
Accept: */* | |
Content-Type: application/x-www-form-urlencoded | |
Content-Length: 112 | |
Host: localhost:8000 | |
request=%7b%22student_uuid%22%3a%2273936fc298864d109b1e7c3707f4cc66%22%2c%22url%22%3a%22%5c%2fthe%5c%2furl%22%7d |
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
Scenario: User making a purchases decreases their balance | |
Given there is a "Foo" widget that costs $75 | |
Given "Joe" is a user with a $100 balance | |
And I am logged in as "Joe" | |
When I purchase "Foo" widget | |
Then I should see "Successfully purchased a Foo widget" | |
When I go my profile page | |
Then I should see my balance is $25 | |
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 findParentWithClass = function(node, className){ | |
var klass; | |
while(true){ | |
if(!node.getAttribute || !node.parentNode){ | |
return; | |
} | |
klass = node.getAttribute("class"); | |
if(klass && klass.split(/\s+/).include(className)){ | |
return node; | |
} |
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 ActiveRecord::Base | |
class << self | |
def establish_connection_with_activerecord_import(*args) | |
establish_connection_without_activerecord_import(*args) | |
ActiveSupport.run_load_hooks(:active_record_connection_established, connection) | |
end | |
alias_method_chain :establish_connection, :activerecord_import | |
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
class Page | |
include Mongoid::Document | |
end | |
class OtherPage < Page | |
field :name | |
end | |
other_page = OtherPage.create :name => "foobar" |
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 ref = foo; | |
var foo = function(){ | |
alert("hi"); | |
} | |
ref(); |