All links are amazon affiliate. I'm recommending you books, it's how I pay to buy my own. ;)
{ | |
"_links": { | |
"self": { "href": "/foo" }, | |
}, | |
"_controls": { | |
"attack": { | |
"target": "/attacks", | |
"method": "POST", | |
"headers": { | |
"Content-Type": "application/json" |
-
Add to
.gitignore
:node_modules public
-
Add to your app
dependencies
ofpackage.json
:
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
##Introduction
One definition of unit testing is the process of taking the smallest piece of testable code in an application, isolating it from the remainder of your codebase and determining if it behaves exactly as expected. In this section, we'll be taking a look at how to unit test Backbone applications using a popular JavaScript testing framework called Jasmine from Pivotal Labs.
For an application to be considered 'well'-tested, distinct functionality should ideally have its own separate unit tests where it's tested against the different conditions you expect it to work under. All tests must pass before functionality is considered 'complete'. This allows developers to both modify a unit of code and it's dependencies with a level of confidence about whether these changes have caused any breakage.
As a basic example of unit testing is where a developer may wish to assert whether passing specific values through to a sum function results in the correct output being re
# before this file is loaded, a locale should be set: | |
# | |
# In a browser environment, you can use: | |
# ```<script>__locale='en';</script>``` | |
# | |
# In a server environment (specifically node.js): | |
# ```global.__locale = 'en';``` | |
# normalize in-app locale string to "en" or "de-AT" | |
parts = @__locale.split('-') |
require 'yajl' | |
module Rack | |
# A Rack middleware for parsing POST/PUT body data when Content-Type is | |
# <tt>application/json</tt>. | |
# | |
class JsonPostBody |
# Gemfile | |
source "http://rubygems.org" | |
gem "openid_dm_store", :git => "git://github.com/therabidbanana/openid_dm_store.git" | |
gem "orange-more", :git => "git://github.com/therabidbanana/orange-more.git" | |
gem "orange-core", :git => "git://github.com/therabidbanana/orange-core.git" | |
gem "orange-sparkles", :git => "git://github.com/orange-project/orange-sparkles.git" | |
gem "dm-postgres-adapter" |