upjs-rails 0.11.0 → 0.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/dist/up.js +138 -81
- data/dist/up.min.js +2 -2
- data/lib/assets/javascripts/up/boot.js.coffee +3 -0
- data/lib/assets/javascripts/up/browser.js.coffee +42 -26
- data/lib/assets/javascripts/up/flow.js.coffee +6 -4
- data/lib/assets/javascripts/up/history.js.coffee +1 -1
- data/lib/assets/javascripts/up/modal.js.coffee +4 -4
- data/lib/assets/javascripts/up/motion.js.coffee +6 -4
- data/lib/assets/javascripts/up/proxy.js.coffee +2 -1
- data/lib/assets/javascripts/up/util.js.coffee +61 -32
- data/lib/assets/javascripts/up.js.coffee +1 -10
- data/lib/upjs/rails/version.rb +1 -1
- data/spec_app/config/environments/development.rb +1 -1
- data/spec_app/spec/javascripts/helpers/reset_path.js.coffee +3 -2
- data/spec_app/spec/javascripts/up/flow_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/history_spec.js.coffee +53 -47
- data/spec_app/spec/javascripts/up/link_spec.js.coffee +1 -1
- data/spec_app/spec/javascripts/up/motion_spec.js.coffee +4 -4
- data/spec_app/spec/javascripts/up/proxy_spec.js.coffee +18 -9
- data/spec_app/vendor/assets/bower_components/jasmine/.bower.json +43 -7
- data/spec_app/vendor/assets/bower_components/jasmine/CONTRIBUTING.md +26 -17
- data/spec_app/vendor/assets/bower_components/jasmine/README.md +27 -18
- data/spec_app/vendor/assets/bower_components/jasmine/RELEASE.md +15 -5
- data/spec_app/vendor/assets/bower_components/jasmine/bower.json +41 -0
- data/spec_app/vendor/assets/bower_components/jasmine/lib/console/console.js +27 -3
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/boot.js +10 -9
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/node_example/{src → lib/jasmine_examples}/Player.js +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/node_example/{src → lib/jasmine_examples}/Song.js +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/jasmine-html.js +76 -20
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/jasmine.css +15 -18
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/jasmine.js +1399 -694
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/json2.js +73 -62
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/node_boot.js +1 -1
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core.js +29 -31
- data/spec_app/vendor/assets/bower_components/jasmine/package.json +18 -7
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/.bower.json +11 -13
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/MIT.LICENSE +1 -1
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/README.markdown +198 -125
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/bower.json +9 -10
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/lib/mock-ajax.js +250 -59
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/package.json +9 -4
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/2.0.2.md +50 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/2.99.md +14 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/3.0.md +28 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/3.1.0.md +24 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/3.1.1.md +23 -0
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/release_notes/3.2.0.md +20 -0
- data/spec_app/vendor/assets/bower_components/jasmine-fixture/.bower.json +4 -4
- data/spec_app/vendor/assets/bower_components/jasmine-fixture/bower.json +1 -1
- data/spec_app/vendor/assets/bower_components/jasmine-fixture/dist/jasmine-fixture.js +4 -4
- data/spec_app/vendor/assets/bower_components/jasmine-fixture/dist/jasmine-fixture.min.js +2 -2
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/.bower.json +4 -4
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/Gruntfile.js +17 -1
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/{MIT.LICENSE → LICENSE} +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/README.md +14 -9
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/bower.json +0 -1
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/lib/jasmine-jquery.js +35 -10
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/package.json +33 -24
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/spec/fixtures/fixture_with_checkbox_with_checked.html +6 -0
- data/spec_app/vendor/assets/bower_components/jasmine-jquery/spec/suites/jasmine-jquery-spec.js +61 -1
- data/spec_app/vendor/assets/bower_components/jquery/.bower.json +5 -4
- data/spec_app/vendor/assets/bower_components/jquery/bower.json +2 -1
- data/spec_app/vendor/assets/bower_components/jquery/dist/jquery.js +9 -4
- data/spec_app/vendor/assets/bower_components/jquery/dist/jquery.min.js +4 -4
- data/spec_app/vendor/assets/bower_components/jquery/dist/jquery.min.map +1 -1
- data/spec_app/vendor/assets/bower_components/jquery/src/core.js +6 -1
- metadata +14 -175
- data/spec_app/vendor/assets/bower_components/jasmine/.gitignore +0 -24
- data/spec_app/vendor/assets/bower_components/jasmine/.gitmodules +0 -3
- data/spec_app/vendor/assets/bower_components/jasmine/.jshintrc +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/.npmignore +0 -21
- data/spec_app/vendor/assets/bower_components/jasmine/.rspec +0 -1
- data/spec_app/vendor/assets/bower_components/jasmine/.travis.yml +0 -51
- data/spec_app/vendor/assets/bower_components/jasmine/Gemfile +0 -12
- data/spec_app/vendor/assets/bower_components/jasmine/Gruntfile.js +0 -53
- data/spec_app/vendor/assets/bower_components/jasmine/Rakefile +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.0.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.1.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.2.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.3.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-1.3.1.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-2.0.0.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-2.0.1.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-2.0.2.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/dist/jasmine-standalone-2.0.3.zip +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/config/compass.js +0 -10
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/config/compress.js +0 -66
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/config/concat.js +0 -61
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/config/jshint.js +0 -11
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/tasks/build_standalone.js +0 -31
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/tasks/version.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/templates/SpecRunner.html.jst +0 -26
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/templates/licenseBanner.js.jst +0 -22
- data/spec_app/vendor/assets/bower_components/jasmine/grunt/templates/version.rb.jst +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/images/__init__.py +0 -0
- data/spec_app/vendor/assets/bower_components/jasmine/jasmine-core.gemspec +0 -23
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/__init__.py +0 -1
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/boot/boot.js +0 -120
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/boot/node_boot.js +0 -19
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/core.py +0 -60
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/node_example/spec/PlayerSpec.js +0 -60
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/node_example/spec/SpecHelper.js +0 -15
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/spec/PlayerSpec.js +0 -58
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/spec/SpecHelper.js +0 -15
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/src/Player.js +0 -22
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/example/src/Song.js +0 -7
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core/version.rb +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/lib/jasmine-core.rb +0 -53
- data/spec_app/vendor/assets/bower_components/jasmine/release_notes/2.0.1.md +0 -70
- data/spec_app/vendor/assets/bower_components/jasmine/release_notes/2.0.2.md +0 -25
- data/spec_app/vendor/assets/bower_components/jasmine/release_notes/20.md +0 -179
- data/spec_app/vendor/assets/bower_components/jasmine/setup.py +0 -47
- data/spec_app/vendor/assets/bower_components/jasmine/spec/console/ConsoleReporterSpec.js +0 -239
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/AnySpec.js +0 -46
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/CallTrackerSpec.js +0 -105
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ClockSpec.js +0 -445
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/DelayedFunctionSchedulerSpec.js +0 -246
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/EnvSpec.js +0 -85
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ExceptionFormatterSpec.js +0 -63
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ExceptionsSpec.js +0 -68
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ExpectationResultSpec.js +0 -61
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ExpectationSpec.js +0 -427
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/JsApiReporterSpec.js +0 -214
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/MockDateSpec.js +0 -199
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ObjectContainingSpec.js +0 -70
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/PrettyPrintSpec.js +0 -156
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/QueueRunnerSpec.js +0 -271
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/ReportDispatcherSpec.js +0 -40
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/SpecSpec.js +0 -260
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/SpySpec.js +0 -67
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/SpyStrategySpec.js +0 -111
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/SuiteSpec.js +0 -216
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/TimerSpec.js +0 -31
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/UtilSpec.js +0 -28
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/integration/CustomMatchersSpec.js +0 -149
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/integration/EnvSpec.js +0 -506
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/integration/SpecRunningSpec.js +0 -306
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/matchersUtilSpec.js +0 -239
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeCloseToSpec.js +0 -51
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeDefinedSpec.js +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeFalsySpec.js +0 -38
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeGreaterThanSpec.js +0 -20
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeLessThanSpec.js +0 -20
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeNaNSpec.js +0 -37
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeNullSpec.js +0 -17
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeSpec.js +0 -17
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeTruthySpec.js +0 -38
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toBeUndefinedSpec.js +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toContainSpec.js +0 -26
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toEqualSpec.js +0 -28
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toHaveBeenCalledSpec.js +0 -47
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toHaveBeenCalledWithSpec.js +0 -66
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toMatchSpec.js +0 -34
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toThrowErrorSpec.js +0 -280
- data/spec_app/vendor/assets/bower_components/jasmine/spec/core/matchers/toThrowSpec.js +0 -99
- data/spec_app/vendor/assets/bower_components/jasmine/spec/helpers/BrowserFlags.js +0 -23
- data/spec_app/vendor/assets/bower_components/jasmine/spec/helpers/defineJasmineUnderTest.js +0 -7
- data/spec_app/vendor/assets/bower_components/jasmine/spec/helpers/nodeDefineJasmineUnderTest.js +0 -33
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/HtmlReporterSpec.js +0 -616
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/HtmlSpecFilterSpec.js +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/MatchersHtmlSpec.js +0 -37
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/PrettyPrintHtmlSpec.js +0 -15
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/QueryStringSpec.js +0 -43
- data/spec_app/vendor/assets/bower_components/jasmine/spec/html/ResultsNodeSpec.js +0 -62
- data/spec_app/vendor/assets/bower_components/jasmine/spec/javascripts/support/jasmine_selenium_runner.yml +0 -16
- data/spec_app/vendor/assets/bower_components/jasmine/spec/performance/large_object_test.js +0 -36
- data/spec_app/vendor/assets/bower_components/jasmine/spec/performance/performance_test.js +0 -10
- data/spec_app/vendor/assets/bower_components/jasmine/spec/support/jasmine-performance.json +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/spec/support/jasmine-performance.yml +0 -9
- data/spec_app/vendor/assets/bower_components/jasmine/spec/support/jasmine.json +0 -10
- data/spec_app/vendor/assets/bower_components/jasmine/spec/support/jasmine.yml +0 -25
- data/spec_app/vendor/assets/bower_components/jasmine/src/console/ConsoleReporter.js +0 -131
- data/spec_app/vendor/assets/bower_components/jasmine/src/console/requireConsole.js +0 -12
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Any.js +0 -36
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/CallTracker.js +0 -50
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Clock.js +0 -113
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/DelayedFunctionScheduler.js +0 -145
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Env.js +0 -341
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/ExceptionFormatter.js +0 -29
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Expectation.js +0 -107
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/ExpectationResult.js +0 -45
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/JsApiReporter.js +0 -73
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/MockDate.js +0 -81
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/ObjectContaining.js +0 -34
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/PrettyPrinter.js +0 -137
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/QueueRunner.js +0 -92
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/ReportDispatcher.js +0 -35
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Spec.js +0 -126
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/SpyStrategy.js +0 -51
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Suite.js +0 -92
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/Timer.js +0 -22
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/base.js +0 -102
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/matchersUtil.js +0 -181
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/requireMatchers.js +0 -29
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBe.js +0 -13
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeCloseTo.js +0 -18
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeDefined.js +0 -13
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeFalsy.js +0 -13
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeGreaterThan.js +0 -15
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeLessThan.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeNaN.js +0 -22
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeNull.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeTruthy.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toBeUndefined.js +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toContain.js +0 -16
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toEqual.js +0 -20
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalled.js +0 -28
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toHaveBeenCalledWith.js +0 -33
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toMatch.js +0 -16
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toThrow.js +0 -46
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/matchers/toThrowError.js +0 -156
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/requireCore.js +0 -39
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/requireInterface.js +0 -59
- data/spec_app/vendor/assets/bower_components/jasmine/src/core/util.js +0 -44
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/HtmlReporter.js +0 -280
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/HtmlSpecFilter.js +0 -12
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/QueryString.js +0 -47
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/ResultsNode.js +0 -19
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/_HTMLReporter.scss +0 -355
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/jasmine.scss +0 -1
- data/spec_app/vendor/assets/bower_components/jasmine/src/html/requireHtml.js +0 -6
- data/spec_app/vendor/assets/bower_components/jasmine/src/templates/example_project_jasmine_tags.html.erb +0 -3
- data/spec_app/vendor/assets/bower_components/jasmine/src/templates/version.js.erb +0 -7
- data/spec_app/vendor/assets/bower_components/jasmine/src/templates/version.rb.erb +0 -6
- data/spec_app/vendor/assets/bower_components/jasmine/src/version.js +0 -3
- data/spec_app/vendor/assets/bower_components/jasmine/travis-core-script.sh +0 -14
- data/spec_app/vendor/assets/bower_components/jasmine/travis-docs-script.sh +0 -5
- data/spec_app/vendor/assets/bower_components/jasmine/travis-node-script.sh +0 -6
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/Gruntfile.js +0 -63
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/boot.js +0 -11
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/fakeRequest.js +0 -262
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/mockAjax.js +0 -45
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/paramParser.js +0 -56
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/requestStub.js +0 -42
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/requestTracker.js +0 -51
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/requireAjax.js +0 -44
- data/spec_app/vendor/assets/bower_components/jasmine-ajax/src/stubTracker.js +0 -24
@@ -1,262 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().AjaxFakeRequest = function() {
|
2
|
-
function extend(destination, source, propertiesToSkip) {
|
3
|
-
propertiesToSkip = propertiesToSkip || [];
|
4
|
-
for (var property in source) {
|
5
|
-
if (!arrayContains(propertiesToSkip, property)) {
|
6
|
-
destination[property] = source[property];
|
7
|
-
}
|
8
|
-
}
|
9
|
-
return destination;
|
10
|
-
}
|
11
|
-
|
12
|
-
function arrayContains(arr, item) {
|
13
|
-
for (var i = 0; i < arr.length; i++) {
|
14
|
-
if (arr[i] === item) {
|
15
|
-
return true;
|
16
|
-
}
|
17
|
-
}
|
18
|
-
return false;
|
19
|
-
}
|
20
|
-
|
21
|
-
function wrapProgressEvent(xhr, eventName) {
|
22
|
-
return function() {
|
23
|
-
if (xhr[eventName]) {
|
24
|
-
xhr[eventName]();
|
25
|
-
}
|
26
|
-
};
|
27
|
-
}
|
28
|
-
|
29
|
-
function initializeEvents(xhr) {
|
30
|
-
return {
|
31
|
-
'loadstart': wrapProgressEvent(xhr, 'onloadstart'),
|
32
|
-
'load': wrapProgressEvent(xhr, 'onload'),
|
33
|
-
'loadend': wrapProgressEvent(xhr, 'onloadend'),
|
34
|
-
'progress': wrapProgressEvent(xhr, 'onprogress'),
|
35
|
-
'error': wrapProgressEvent(xhr, 'onerror'),
|
36
|
-
'abort': wrapProgressEvent(xhr, 'onabort'),
|
37
|
-
'timeout': wrapProgressEvent(xhr, 'ontimeout')
|
38
|
-
};
|
39
|
-
}
|
40
|
-
|
41
|
-
function fakeRequest(global, requestTracker, stubTracker, paramParser) {
|
42
|
-
function FakeXMLHttpRequest() {
|
43
|
-
requestTracker.track(this);
|
44
|
-
this.events = initializeEvents(this);
|
45
|
-
this.requestHeaders = {};
|
46
|
-
this.overriddenMimeType = null;
|
47
|
-
}
|
48
|
-
|
49
|
-
function findHeader(name, headers) {
|
50
|
-
name = name.toLowerCase();
|
51
|
-
for (var header in headers) {
|
52
|
-
if (header.toLowerCase() === name) {
|
53
|
-
return headers[header];
|
54
|
-
}
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
function normalizeHeaders(rawHeaders, contentType) {
|
59
|
-
var headers = [];
|
60
|
-
|
61
|
-
if (rawHeaders) {
|
62
|
-
if (rawHeaders instanceof Array) {
|
63
|
-
headers = rawHeaders;
|
64
|
-
} else {
|
65
|
-
for (var headerName in rawHeaders) {
|
66
|
-
if (rawHeaders.hasOwnProperty(headerName)) {
|
67
|
-
headers.push({ name: headerName, value: rawHeaders[headerName] });
|
68
|
-
}
|
69
|
-
}
|
70
|
-
}
|
71
|
-
} else {
|
72
|
-
headers.push({ name: "Content-Type", value: contentType || "application/json" });
|
73
|
-
}
|
74
|
-
|
75
|
-
return headers;
|
76
|
-
}
|
77
|
-
|
78
|
-
function parseXml(xmlText, contentType) {
|
79
|
-
if (global.DOMParser) {
|
80
|
-
return (new global.DOMParser()).parseFromString(xmlText, 'text/xml');
|
81
|
-
} else {
|
82
|
-
var xml = new global.ActiveXObject("Microsoft.XMLDOM");
|
83
|
-
xml.async = "false";
|
84
|
-
xml.loadXML(xmlText);
|
85
|
-
return xml;
|
86
|
-
}
|
87
|
-
}
|
88
|
-
|
89
|
-
var xmlParsables = ['text/xml', 'application/xml'];
|
90
|
-
|
91
|
-
function getResponseXml(responseText, contentType) {
|
92
|
-
if (arrayContains(xmlParsables, contentType.toLowerCase())) {
|
93
|
-
return parseXml(responseText, contentType);
|
94
|
-
} else if (contentType.match(/\+xml$/)) {
|
95
|
-
return parseXml(responseText, 'text/xml');
|
96
|
-
}
|
97
|
-
return null;
|
98
|
-
}
|
99
|
-
|
100
|
-
var iePropertiesThatCannotBeCopied = ['responseBody', 'responseText', 'responseXML', 'status', 'statusText', 'responseTimeout'];
|
101
|
-
extend(FakeXMLHttpRequest.prototype, new global.XMLHttpRequest(), iePropertiesThatCannotBeCopied);
|
102
|
-
extend(FakeXMLHttpRequest.prototype, {
|
103
|
-
open: function() {
|
104
|
-
this.method = arguments[0];
|
105
|
-
this.url = arguments[1];
|
106
|
-
this.username = arguments[3];
|
107
|
-
this.password = arguments[4];
|
108
|
-
this.readyState = 1;
|
109
|
-
this.onreadystatechange();
|
110
|
-
},
|
111
|
-
|
112
|
-
setRequestHeader: function(header, value) {
|
113
|
-
if(this.requestHeaders.hasOwnProperty(header)) {
|
114
|
-
this.requestHeaders[header] = [this.requestHeaders[header], value].join(', ');
|
115
|
-
} else {
|
116
|
-
this.requestHeaders[header] = value;
|
117
|
-
}
|
118
|
-
},
|
119
|
-
|
120
|
-
overrideMimeType: function(mime) {
|
121
|
-
this.overriddenMimeType = mime;
|
122
|
-
},
|
123
|
-
|
124
|
-
abort: function() {
|
125
|
-
this.readyState = 0;
|
126
|
-
this.status = 0;
|
127
|
-
this.statusText = "abort";
|
128
|
-
this.onreadystatechange();
|
129
|
-
this.events.progress();
|
130
|
-
this.events.abort();
|
131
|
-
this.events.loadend();
|
132
|
-
},
|
133
|
-
|
134
|
-
readyState: 0,
|
135
|
-
|
136
|
-
onloadstart: null,
|
137
|
-
onprogress: null,
|
138
|
-
onabort: null,
|
139
|
-
onerror: null,
|
140
|
-
onload: null,
|
141
|
-
ontimeout: null,
|
142
|
-
onloadend: null,
|
143
|
-
|
144
|
-
onreadystatechange: function(isTimeout) {
|
145
|
-
},
|
146
|
-
|
147
|
-
addEventListener: function(event, callback) {
|
148
|
-
var existingCallback = this.events[event],
|
149
|
-
self = this;
|
150
|
-
|
151
|
-
this.events[event] = function() {
|
152
|
-
callback.apply(self);
|
153
|
-
existingCallback();
|
154
|
-
};
|
155
|
-
},
|
156
|
-
|
157
|
-
status: null,
|
158
|
-
|
159
|
-
send: function(data) {
|
160
|
-
this.params = data;
|
161
|
-
this.readyState = 2;
|
162
|
-
this.events.loadstart();
|
163
|
-
this.onreadystatechange();
|
164
|
-
|
165
|
-
var stub = stubTracker.findStub(this.url, data, this.method);
|
166
|
-
if (stub) {
|
167
|
-
this.respondWith(stub);
|
168
|
-
}
|
169
|
-
},
|
170
|
-
|
171
|
-
contentType: function() {
|
172
|
-
return findHeader('content-type', this.requestHeaders);
|
173
|
-
},
|
174
|
-
|
175
|
-
data: function() {
|
176
|
-
if (!this.params) {
|
177
|
-
return {};
|
178
|
-
}
|
179
|
-
|
180
|
-
return paramParser.findParser(this).parse(this.params);
|
181
|
-
},
|
182
|
-
|
183
|
-
getResponseHeader: function(name) {
|
184
|
-
name = name.toLowerCase();
|
185
|
-
var resultHeader;
|
186
|
-
for(var i = 0; i < this.responseHeaders.length; i++) {
|
187
|
-
var header = this.responseHeaders[i];
|
188
|
-
if (name === header.name.toLowerCase()) {
|
189
|
-
if (resultHeader) {
|
190
|
-
resultHeader = [resultHeader, header.value].join(', ');
|
191
|
-
} else {
|
192
|
-
resultHeader = header.value;
|
193
|
-
}
|
194
|
-
}
|
195
|
-
}
|
196
|
-
return resultHeader;
|
197
|
-
},
|
198
|
-
|
199
|
-
getAllResponseHeaders: function() {
|
200
|
-
var responseHeaders = [];
|
201
|
-
for (var i = 0; i < this.responseHeaders.length; i++) {
|
202
|
-
responseHeaders.push(this.responseHeaders[i].name + ': ' +
|
203
|
-
this.responseHeaders[i].value);
|
204
|
-
}
|
205
|
-
return responseHeaders.join('\r\n');
|
206
|
-
},
|
207
|
-
|
208
|
-
responseText: null,
|
209
|
-
|
210
|
-
response: function(response) {
|
211
|
-
if (window.console && window.console.warn) {
|
212
|
-
window.console.warn("jasmine-ajax's response method is deprecated because it conflicts with XmlHTTPRequest 2 sytax. It will be removed in a later version. Please use respondWith");
|
213
|
-
}
|
214
|
-
this.respondWith(response);
|
215
|
-
},
|
216
|
-
|
217
|
-
respondWith: function(response) {
|
218
|
-
if (this.readyState === 4) {
|
219
|
-
throw new Error("FakeXMLHttpRequest already completed");
|
220
|
-
}
|
221
|
-
this.status = response.status;
|
222
|
-
this.statusText = response.statusText || "";
|
223
|
-
this.responseText = response.responseText || "";
|
224
|
-
this.readyState = 4;
|
225
|
-
this.responseHeaders = normalizeHeaders(response.responseHeaders, response.contentType);
|
226
|
-
this.responseXML = getResponseXml(response.responseText, this.getResponseHeader('content-type') || '');
|
227
|
-
|
228
|
-
this.onreadystatechange();
|
229
|
-
this.events.progress();
|
230
|
-
this.events.load();
|
231
|
-
this.events.loadend();
|
232
|
-
},
|
233
|
-
|
234
|
-
responseTimeout: function() {
|
235
|
-
if (this.readyState === 4) {
|
236
|
-
throw new Error("FakeXMLHttpRequest already completed");
|
237
|
-
}
|
238
|
-
this.readyState = 4;
|
239
|
-
jasmine.clock().tick(30000);
|
240
|
-
this.onreadystatechange('timeout');
|
241
|
-
this.events.progress();
|
242
|
-
this.events.timeout();
|
243
|
-
this.events.loadend();
|
244
|
-
},
|
245
|
-
|
246
|
-
responseError: function() {
|
247
|
-
if (this.readyState === 4) {
|
248
|
-
throw new Error("FakeXMLHttpRequest already completed");
|
249
|
-
}
|
250
|
-
this.readyState = 4;
|
251
|
-
this.onreadystatechange();
|
252
|
-
this.events.progress();
|
253
|
-
this.events.error();
|
254
|
-
this.events.loadend();
|
255
|
-
}
|
256
|
-
});
|
257
|
-
|
258
|
-
return FakeXMLHttpRequest;
|
259
|
-
}
|
260
|
-
|
261
|
-
return fakeRequest;
|
262
|
-
};
|
@@ -1,45 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().MockAjax = function($ajax) {
|
2
|
-
function MockAjax(global) {
|
3
|
-
var requestTracker = new $ajax.RequestTracker(),
|
4
|
-
stubTracker = new $ajax.StubTracker(),
|
5
|
-
paramParser = new $ajax.ParamParser(),
|
6
|
-
realAjaxFunction = global.XMLHttpRequest,
|
7
|
-
mockAjaxFunction = $ajax.fakeRequest(global, requestTracker, stubTracker, paramParser);
|
8
|
-
|
9
|
-
this.install = function() {
|
10
|
-
global.XMLHttpRequest = mockAjaxFunction;
|
11
|
-
};
|
12
|
-
|
13
|
-
this.uninstall = function() {
|
14
|
-
global.XMLHttpRequest = realAjaxFunction;
|
15
|
-
|
16
|
-
this.stubs.reset();
|
17
|
-
this.requests.reset();
|
18
|
-
paramParser.reset();
|
19
|
-
};
|
20
|
-
|
21
|
-
this.stubRequest = function(url, data, method) {
|
22
|
-
var stub = new $ajax.RequestStub(url, data, method);
|
23
|
-
stubTracker.addStub(stub);
|
24
|
-
return stub;
|
25
|
-
};
|
26
|
-
|
27
|
-
this.withMock = function(closure) {
|
28
|
-
this.install();
|
29
|
-
try {
|
30
|
-
closure();
|
31
|
-
} finally {
|
32
|
-
this.uninstall();
|
33
|
-
}
|
34
|
-
};
|
35
|
-
|
36
|
-
this.addCustomParamParser = function(parser) {
|
37
|
-
paramParser.add(parser);
|
38
|
-
};
|
39
|
-
|
40
|
-
this.requests = requestTracker;
|
41
|
-
this.stubs = stubTracker;
|
42
|
-
}
|
43
|
-
|
44
|
-
return MockAjax;
|
45
|
-
};
|
@@ -1,56 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().AjaxParamParser = function() {
|
2
|
-
function ParamParser() {
|
3
|
-
var defaults = [
|
4
|
-
{
|
5
|
-
test: function(xhr) {
|
6
|
-
return (/^application\/json/).test(xhr.contentType());
|
7
|
-
},
|
8
|
-
parse: function jsonParser(paramString) {
|
9
|
-
return JSON.parse(paramString);
|
10
|
-
}
|
11
|
-
},
|
12
|
-
{
|
13
|
-
test: function(xhr) {
|
14
|
-
return true;
|
15
|
-
},
|
16
|
-
parse: function naiveParser(paramString) {
|
17
|
-
var data = {};
|
18
|
-
var params = paramString.split('&');
|
19
|
-
|
20
|
-
for (var i = 0; i < params.length; ++i) {
|
21
|
-
var kv = params[i].replace(/\+/g, ' ').split('=');
|
22
|
-
var key = decodeURIComponent(kv[0]);
|
23
|
-
data[key] = data[key] || [];
|
24
|
-
data[key].push(decodeURIComponent(kv[1]));
|
25
|
-
}
|
26
|
-
return data;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
];
|
30
|
-
var paramParsers = [];
|
31
|
-
|
32
|
-
this.add = function(parser) {
|
33
|
-
paramParsers.unshift(parser);
|
34
|
-
};
|
35
|
-
|
36
|
-
this.findParser = function(xhr) {
|
37
|
-
for(var i in paramParsers) {
|
38
|
-
var parser = paramParsers[i];
|
39
|
-
if (parser.test(xhr)) {
|
40
|
-
return parser;
|
41
|
-
}
|
42
|
-
}
|
43
|
-
};
|
44
|
-
|
45
|
-
this.reset = function() {
|
46
|
-
paramParsers = [];
|
47
|
-
for(var i in defaults) {
|
48
|
-
paramParsers.push(defaults[i]);
|
49
|
-
}
|
50
|
-
};
|
51
|
-
|
52
|
-
this.reset();
|
53
|
-
}
|
54
|
-
|
55
|
-
return ParamParser;
|
56
|
-
};
|
@@ -1,42 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().AjaxRequestStub = function() {
|
2
|
-
function RequestStub(url, stubData, method) {
|
3
|
-
var normalizeQuery = function(query) {
|
4
|
-
return query ? query.split('&').sort().join('&') : undefined;
|
5
|
-
};
|
6
|
-
|
7
|
-
if (url instanceof RegExp) {
|
8
|
-
this.url = url;
|
9
|
-
this.query = undefined;
|
10
|
-
} else {
|
11
|
-
var split = url.split('?');
|
12
|
-
this.url = split[0];
|
13
|
-
this.query = split.length > 1 ? normalizeQuery(split[1]) : undefined;
|
14
|
-
}
|
15
|
-
|
16
|
-
this.data = normalizeQuery(stubData);
|
17
|
-
this.method = method;
|
18
|
-
|
19
|
-
this.andReturn = function(options) {
|
20
|
-
this.status = options.status || 200;
|
21
|
-
|
22
|
-
this.contentType = options.contentType;
|
23
|
-
this.responseText = options.responseText;
|
24
|
-
};
|
25
|
-
|
26
|
-
this.matches = function(fullUrl, data, method) {
|
27
|
-
var matches = false;
|
28
|
-
fullUrl = fullUrl.toString();
|
29
|
-
if (this.url instanceof RegExp) {
|
30
|
-
matches = this.url.test(fullUrl);
|
31
|
-
} else {
|
32
|
-
var urlSplit = fullUrl.split('?'),
|
33
|
-
url = urlSplit[0],
|
34
|
-
query = urlSplit[1];
|
35
|
-
matches = this.url === url && this.query === normalizeQuery(query);
|
36
|
-
}
|
37
|
-
return matches && (!this.data || this.data === normalizeQuery(data)) && (!this.method || this.method === method);
|
38
|
-
};
|
39
|
-
}
|
40
|
-
|
41
|
-
return RequestStub;
|
42
|
-
};
|
@@ -1,51 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().AjaxRequestTracker = function() {
|
2
|
-
function RequestTracker() {
|
3
|
-
var requests = [];
|
4
|
-
|
5
|
-
this.track = function(request) {
|
6
|
-
requests.push(request);
|
7
|
-
};
|
8
|
-
|
9
|
-
this.first = function() {
|
10
|
-
return requests[0];
|
11
|
-
};
|
12
|
-
|
13
|
-
this.count = function() {
|
14
|
-
return requests.length;
|
15
|
-
};
|
16
|
-
|
17
|
-
this.reset = function() {
|
18
|
-
requests = [];
|
19
|
-
};
|
20
|
-
|
21
|
-
this.mostRecent = function() {
|
22
|
-
return requests[requests.length - 1];
|
23
|
-
};
|
24
|
-
|
25
|
-
this.at = function(index) {
|
26
|
-
return requests[index];
|
27
|
-
};
|
28
|
-
|
29
|
-
this.filter = function(url_to_match) {
|
30
|
-
var matching_requests = [];
|
31
|
-
|
32
|
-
for (var i = 0; i < requests.length; i++) {
|
33
|
-
if (url_to_match instanceof RegExp &&
|
34
|
-
url_to_match.test(requests[i].url)) {
|
35
|
-
matching_requests.push(requests[i]);
|
36
|
-
} else if (url_to_match instanceof Function &&
|
37
|
-
url_to_match(requests[i])) {
|
38
|
-
matching_requests.push(requests[i]);
|
39
|
-
} else {
|
40
|
-
if (requests[i].url === url_to_match) {
|
41
|
-
matching_requests.push(requests[i]);
|
42
|
-
}
|
43
|
-
}
|
44
|
-
}
|
45
|
-
|
46
|
-
return matching_requests;
|
47
|
-
};
|
48
|
-
}
|
49
|
-
|
50
|
-
return RequestTracker;
|
51
|
-
};
|
@@ -1,44 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
|
3
|
-
Jasmine-Ajax : a set of helpers for testing AJAX requests under the Jasmine
|
4
|
-
BDD framework for JavaScript.
|
5
|
-
|
6
|
-
http://github.com/pivotal/jasmine-ajax
|
7
|
-
|
8
|
-
Jasmine Home page: http://pivotal.github.com/jasmine
|
9
|
-
|
10
|
-
Copyright (c) 2008-2013 Pivotal Labs
|
11
|
-
|
12
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
13
|
-
a copy of this software and associated documentation files (the
|
14
|
-
"Software"), to deal in the Software without restriction, including
|
15
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
16
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
17
|
-
permit persons to whom the Software is furnished to do so, subject to
|
18
|
-
the following conditions:
|
19
|
-
|
20
|
-
The above copyright notice and this permission notice shall be
|
21
|
-
included in all copies or substantial portions of the Software.
|
22
|
-
|
23
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
24
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
25
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
26
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
27
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
28
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
29
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
30
|
-
|
31
|
-
*/
|
32
|
-
|
33
|
-
getJasmineRequireObj().ajax = function(jRequire) {
|
34
|
-
var $ajax = {};
|
35
|
-
|
36
|
-
$ajax.RequestStub = jRequire.AjaxRequestStub();
|
37
|
-
$ajax.RequestTracker = jRequire.AjaxRequestTracker();
|
38
|
-
$ajax.StubTracker = jRequire.AjaxStubTracker();
|
39
|
-
$ajax.ParamParser = jRequire.AjaxParamParser();
|
40
|
-
$ajax.fakeRequest = jRequire.AjaxFakeRequest();
|
41
|
-
$ajax.MockAjax = jRequire.MockAjax($ajax);
|
42
|
-
|
43
|
-
return $ajax.MockAjax;
|
44
|
-
};
|
@@ -1,24 +0,0 @@
|
|
1
|
-
getJasmineRequireObj().AjaxStubTracker = function() {
|
2
|
-
function StubTracker() {
|
3
|
-
var stubs = [];
|
4
|
-
|
5
|
-
this.addStub = function(stub) {
|
6
|
-
stubs.push(stub);
|
7
|
-
};
|
8
|
-
|
9
|
-
this.reset = function() {
|
10
|
-
stubs = [];
|
11
|
-
};
|
12
|
-
|
13
|
-
this.findStub = function(url, data, method) {
|
14
|
-
for (var i = stubs.length - 1; i >= 0; i--) {
|
15
|
-
var stub = stubs[i];
|
16
|
-
if (stub.matches(url, data, method)) {
|
17
|
-
return stub;
|
18
|
-
}
|
19
|
-
}
|
20
|
-
};
|
21
|
-
}
|
22
|
-
|
23
|
-
return StubTracker;
|
24
|
-
};
|