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,445 +0,0 @@
|
|
1
|
-
describe("Clock", function() {
|
2
|
-
|
3
|
-
it("does not replace setTimeout until it is installed", function() {
|
4
|
-
var fakeSetTimeout = jasmine.createSpy("global setTimeout"),
|
5
|
-
fakeGlobal = { setTimeout: fakeSetTimeout },
|
6
|
-
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction"]),
|
7
|
-
delayedFn = jasmine.createSpy("delayedFn"),
|
8
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
9
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
10
|
-
|
11
|
-
fakeGlobal.setTimeout(delayedFn, 0);
|
12
|
-
|
13
|
-
expect(fakeSetTimeout).toHaveBeenCalledWith(delayedFn, 0);
|
14
|
-
expect(delayedFunctionScheduler.scheduleFunction).not.toHaveBeenCalled();
|
15
|
-
|
16
|
-
fakeSetTimeout.calls.reset();
|
17
|
-
|
18
|
-
clock.install();
|
19
|
-
fakeGlobal.setTimeout(delayedFn, 0);
|
20
|
-
|
21
|
-
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalled();
|
22
|
-
expect(fakeSetTimeout).not.toHaveBeenCalled();
|
23
|
-
});
|
24
|
-
|
25
|
-
it("does not replace clearTimeout until it is installed", function() {
|
26
|
-
var fakeClearTimeout = jasmine.createSpy("global cleartimeout"),
|
27
|
-
fakeGlobal = { clearTimeout: fakeClearTimeout },
|
28
|
-
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["removeFunctionWithId"]),
|
29
|
-
delayedFn = jasmine.createSpy("delayedFn"),
|
30
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
31
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
32
|
-
|
33
|
-
fakeGlobal.clearTimeout("foo");
|
34
|
-
|
35
|
-
expect(fakeClearTimeout).toHaveBeenCalledWith("foo");
|
36
|
-
expect(delayedFunctionScheduler.removeFunctionWithId).not.toHaveBeenCalled();
|
37
|
-
|
38
|
-
fakeClearTimeout.calls.reset();
|
39
|
-
|
40
|
-
clock.install();
|
41
|
-
fakeGlobal.clearTimeout("foo");
|
42
|
-
|
43
|
-
expect(delayedFunctionScheduler.removeFunctionWithId).toHaveBeenCalled();
|
44
|
-
expect(fakeClearTimeout).not.toHaveBeenCalled();
|
45
|
-
});
|
46
|
-
|
47
|
-
it("does not replace setInterval until it is installed", function() {
|
48
|
-
var fakeSetInterval = jasmine.createSpy("global setInterval"),
|
49
|
-
fakeGlobal = { setInterval: fakeSetInterval },
|
50
|
-
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction"]),
|
51
|
-
delayedFn = jasmine.createSpy("delayedFn"),
|
52
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
53
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
54
|
-
|
55
|
-
fakeGlobal.setInterval(delayedFn, 0);
|
56
|
-
|
57
|
-
expect(fakeSetInterval).toHaveBeenCalledWith(delayedFn, 0);
|
58
|
-
expect(delayedFunctionScheduler.scheduleFunction).not.toHaveBeenCalled();
|
59
|
-
|
60
|
-
fakeSetInterval.calls.reset();
|
61
|
-
|
62
|
-
clock.install();
|
63
|
-
fakeGlobal.setInterval(delayedFn, 0);
|
64
|
-
|
65
|
-
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalled();
|
66
|
-
expect(fakeSetInterval).not.toHaveBeenCalled();
|
67
|
-
});
|
68
|
-
|
69
|
-
it("does not replace clearInterval until it is installed", function() {
|
70
|
-
var fakeClearInterval = jasmine.createSpy("global clearinterval"),
|
71
|
-
fakeGlobal = { clearInterval: fakeClearInterval },
|
72
|
-
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["removeFunctionWithId"]),
|
73
|
-
delayedFn = jasmine.createSpy("delayedFn"),
|
74
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
75
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
76
|
-
|
77
|
-
fakeGlobal.clearInterval("foo");
|
78
|
-
|
79
|
-
expect(fakeClearInterval).toHaveBeenCalledWith("foo");
|
80
|
-
expect(delayedFunctionScheduler.removeFunctionWithId).not.toHaveBeenCalled();
|
81
|
-
|
82
|
-
fakeClearInterval.calls.reset();
|
83
|
-
|
84
|
-
clock.install();
|
85
|
-
fakeGlobal.clearInterval("foo");
|
86
|
-
|
87
|
-
expect(delayedFunctionScheduler.removeFunctionWithId).toHaveBeenCalled();
|
88
|
-
expect(fakeClearInterval).not.toHaveBeenCalled();
|
89
|
-
});
|
90
|
-
|
91
|
-
it("replaces the global timer functions on uninstall", function() {
|
92
|
-
var fakeSetTimeout = jasmine.createSpy("global setTimeout"),
|
93
|
-
fakeClearTimeout = jasmine.createSpy("global clearTimeout"),
|
94
|
-
fakeSetInterval = jasmine.createSpy("global setInterval"),
|
95
|
-
fakeClearInterval = jasmine.createSpy("global clearInterval"),
|
96
|
-
fakeGlobal = {
|
97
|
-
setTimeout: fakeSetTimeout,
|
98
|
-
clearTimeout: fakeClearTimeout,
|
99
|
-
setInterval: fakeSetInterval,
|
100
|
-
clearInterval: fakeClearInterval
|
101
|
-
},
|
102
|
-
delayedFunctionScheduler = jasmine.createSpyObj("delayedFunctionScheduler", ["scheduleFunction", "reset"]),
|
103
|
-
delayedFn = jasmine.createSpy("delayedFn"),
|
104
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
105
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
106
|
-
|
107
|
-
clock.install();
|
108
|
-
clock.uninstall();
|
109
|
-
fakeGlobal.setTimeout(delayedFn, 0);
|
110
|
-
fakeGlobal.clearTimeout("foo");
|
111
|
-
fakeGlobal.setInterval(delayedFn, 10);
|
112
|
-
fakeGlobal.clearInterval("bar");
|
113
|
-
|
114
|
-
expect(fakeSetTimeout).toHaveBeenCalledWith(delayedFn, 0);
|
115
|
-
expect(fakeClearTimeout).toHaveBeenCalledWith("foo");
|
116
|
-
expect(fakeSetInterval).toHaveBeenCalledWith(delayedFn, 10);
|
117
|
-
expect(fakeClearInterval).toHaveBeenCalledWith("bar");
|
118
|
-
expect(delayedFunctionScheduler.scheduleFunction).not.toHaveBeenCalled();
|
119
|
-
});
|
120
|
-
|
121
|
-
it("schedules the delayed function (via setTimeout) with the fake timer", function() {
|
122
|
-
var fakeSetTimeout = jasmine.createSpy('setTimeout'),
|
123
|
-
scheduleFunction = jasmine.createSpy('scheduleFunction'),
|
124
|
-
delayedFunctionScheduler = { scheduleFunction: scheduleFunction },
|
125
|
-
fakeGlobal = { setTimeout: fakeSetTimeout },
|
126
|
-
delayedFn = jasmine.createSpy('delayedFn'),
|
127
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
128
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
129
|
-
|
130
|
-
clock.install();
|
131
|
-
clock.setTimeout(delayedFn, 0, 'a', 'b');
|
132
|
-
|
133
|
-
expect(fakeSetTimeout).not.toHaveBeenCalled();
|
134
|
-
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalledWith(delayedFn, 0, ['a', 'b']);
|
135
|
-
});
|
136
|
-
|
137
|
-
it("returns an id for the delayed function", function() {
|
138
|
-
var fakeSetTimeout = jasmine.createSpy('setTimeout'),
|
139
|
-
scheduleId = 123,
|
140
|
-
scheduleFunction = jasmine.createSpy('scheduleFunction').and.returnValue(scheduleId),
|
141
|
-
delayedFunctionScheduler = {scheduleFunction: scheduleFunction},
|
142
|
-
fakeGlobal = { setTimeout: fakeSetTimeout },
|
143
|
-
delayedFn = jasmine.createSpy('delayedFn'),
|
144
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
145
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate),
|
146
|
-
timeoutId;
|
147
|
-
|
148
|
-
clock.install();
|
149
|
-
timeoutId = clock.setTimeout(delayedFn, 0);
|
150
|
-
|
151
|
-
expect(timeoutId).toEqual(123);
|
152
|
-
});
|
153
|
-
|
154
|
-
it("clears the scheduled function with the scheduler", function() {
|
155
|
-
var fakeClearTimeout = jasmine.createSpy('clearTimeout'),
|
156
|
-
delayedFunctionScheduler = jasmine.createSpyObj('delayedFunctionScheduler', ['removeFunctionWithId']),
|
157
|
-
fakeGlobal = { setTimeout: fakeClearTimeout },
|
158
|
-
delayedFn = jasmine.createSpy('delayedFn'),
|
159
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
160
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
161
|
-
|
162
|
-
clock.install();
|
163
|
-
clock.clearTimeout(123);
|
164
|
-
|
165
|
-
expect(fakeClearTimeout).not.toHaveBeenCalled();
|
166
|
-
expect(delayedFunctionScheduler.removeFunctionWithId).toHaveBeenCalledWith(123);
|
167
|
-
});
|
168
|
-
|
169
|
-
it("schedules the delayed function with the fake timer", function() {
|
170
|
-
var fakeSetInterval = jasmine.createSpy('setInterval'),
|
171
|
-
scheduleFunction = jasmine.createSpy('scheduleFunction'),
|
172
|
-
delayedFunctionScheduler = {scheduleFunction: scheduleFunction},
|
173
|
-
fakeGlobal = { setInterval: fakeSetInterval },
|
174
|
-
delayedFn = jasmine.createSpy('delayedFn'),
|
175
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
176
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
177
|
-
|
178
|
-
clock.install();
|
179
|
-
clock.setInterval(delayedFn, 0, 'a', 'b');
|
180
|
-
|
181
|
-
expect(fakeSetInterval).not.toHaveBeenCalled();
|
182
|
-
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalledWith(delayedFn, 0, ['a', 'b'], true);
|
183
|
-
});
|
184
|
-
|
185
|
-
it("returns an id for the delayed function", function() {
|
186
|
-
var fakeSetInterval = jasmine.createSpy('setInterval'),
|
187
|
-
scheduleId = 123,
|
188
|
-
scheduleFunction = jasmine.createSpy('scheduleFunction').and.returnValue(scheduleId),
|
189
|
-
delayedFunctionScheduler = {scheduleFunction: scheduleFunction},
|
190
|
-
fakeGlobal = { setInterval: fakeSetInterval },
|
191
|
-
delayedFn = jasmine.createSpy('delayedFn'),
|
192
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
193
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate),
|
194
|
-
intervalId;
|
195
|
-
|
196
|
-
clock.install();
|
197
|
-
intervalId = clock.setInterval(delayedFn, 0);
|
198
|
-
|
199
|
-
expect(intervalId).toEqual(123);
|
200
|
-
});
|
201
|
-
|
202
|
-
it("clears the scheduled function with the scheduler", function() {
|
203
|
-
var clearInterval = jasmine.createSpy('clearInterval'),
|
204
|
-
delayedFunctionScheduler = jasmine.createSpyObj('delayedFunctionScheduler', ['removeFunctionWithId']),
|
205
|
-
fakeGlobal = { setInterval: clearInterval },
|
206
|
-
delayedFn = jasmine.createSpy('delayedFn'),
|
207
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
208
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
209
|
-
|
210
|
-
clock.install();
|
211
|
-
clock.clearInterval(123);
|
212
|
-
|
213
|
-
expect(clearInterval).not.toHaveBeenCalled();
|
214
|
-
expect(delayedFunctionScheduler.removeFunctionWithId).toHaveBeenCalledWith(123);
|
215
|
-
});
|
216
|
-
|
217
|
-
it("gives you a friendly reminder if the Clock is not installed and you tick", function() {
|
218
|
-
var clock = new j$.Clock({}, jasmine.createSpyObj('delayedFunctionScheduler', ['tick']));
|
219
|
-
expect(function() {
|
220
|
-
clock.tick(50);
|
221
|
-
}).toThrow();
|
222
|
-
});
|
223
|
-
|
224
|
-
it("on IE < 9, fails if extra args are passed to fake clock", function() {
|
225
|
-
//fail, because this would break in IE9.
|
226
|
-
var fakeSetTimeout = jasmine.createSpy('setTimeout'),
|
227
|
-
fakeSetInterval = jasmine.createSpy('setInterval'),
|
228
|
-
delayedFunctionScheduler = jasmine.createSpyObj('delayedFunctionScheduler', ['scheduleFunction']),
|
229
|
-
fn = jasmine.createSpy('fn'),
|
230
|
-
fakeGlobal = {
|
231
|
-
setTimeout: fakeSetTimeout,
|
232
|
-
setInterval: fakeSetInterval
|
233
|
-
},
|
234
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
235
|
-
clock = new j$.Clock(fakeGlobal, delayedFunctionScheduler, mockDate);
|
236
|
-
|
237
|
-
fakeSetTimeout.apply = null;
|
238
|
-
fakeSetInterval.apply = null;
|
239
|
-
|
240
|
-
clock.install();
|
241
|
-
|
242
|
-
clock.setTimeout(fn, 0);
|
243
|
-
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalledWith(fn, 0, []);
|
244
|
-
expect(function() {
|
245
|
-
clock.setTimeout(fn, 0, 'extra');
|
246
|
-
}).toThrow();
|
247
|
-
|
248
|
-
clock.setInterval(fn, 0);
|
249
|
-
expect(delayedFunctionScheduler.scheduleFunction).toHaveBeenCalledWith(fn, 0, [], true);
|
250
|
-
expect(function() {
|
251
|
-
clock.setInterval(fn, 0, 'extra');
|
252
|
-
}).toThrow();
|
253
|
-
});
|
254
|
-
|
255
|
-
});
|
256
|
-
|
257
|
-
describe("Clock (acceptance)", function() {
|
258
|
-
it("can run setTimeouts/setIntervals synchronously", function() {
|
259
|
-
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
260
|
-
delayedFn2 = jasmine.createSpy('delayedFn2'),
|
261
|
-
delayedFn3 = jasmine.createSpy('delayedFn3'),
|
262
|
-
recurring1 = jasmine.createSpy('recurring1'),
|
263
|
-
delayedFunctionScheduler = new j$.DelayedFunctionScheduler(),
|
264
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
265
|
-
clock = new j$.Clock({setTimeout: setTimeout}, delayedFunctionScheduler, mockDate);
|
266
|
-
|
267
|
-
clock.install();
|
268
|
-
|
269
|
-
clock.setTimeout(delayedFn1, 0);
|
270
|
-
var intervalId = clock.setInterval(recurring1, 50);
|
271
|
-
clock.setTimeout(delayedFn2, 100);
|
272
|
-
clock.setTimeout(delayedFn3, 200);
|
273
|
-
|
274
|
-
expect(delayedFn1).not.toHaveBeenCalled();
|
275
|
-
expect(delayedFn2).not.toHaveBeenCalled();
|
276
|
-
expect(delayedFn3).not.toHaveBeenCalled();
|
277
|
-
|
278
|
-
clock.tick(0);
|
279
|
-
|
280
|
-
expect(delayedFn1).toHaveBeenCalled();
|
281
|
-
expect(delayedFn2).not.toHaveBeenCalled();
|
282
|
-
expect(delayedFn3).not.toHaveBeenCalled();
|
283
|
-
|
284
|
-
clock.tick(50);
|
285
|
-
|
286
|
-
expect(recurring1).toHaveBeenCalled();
|
287
|
-
expect(recurring1.calls.count()).toBe(1);
|
288
|
-
expect(delayedFn2).not.toHaveBeenCalled();
|
289
|
-
expect(delayedFn3).not.toHaveBeenCalled();
|
290
|
-
|
291
|
-
clock.tick(50);
|
292
|
-
|
293
|
-
expect(recurring1.calls.count()).toBe(2);
|
294
|
-
expect(delayedFn2).toHaveBeenCalled();
|
295
|
-
expect(delayedFn3).not.toHaveBeenCalled();
|
296
|
-
|
297
|
-
clock.tick(100);
|
298
|
-
|
299
|
-
expect(recurring1.calls.count()).toBe(4);
|
300
|
-
expect(delayedFn3).toHaveBeenCalled();
|
301
|
-
|
302
|
-
clock.clearInterval(intervalId);
|
303
|
-
clock.tick(50);
|
304
|
-
|
305
|
-
expect(recurring1.calls.count()).toBe(4);
|
306
|
-
});
|
307
|
-
|
308
|
-
it("can clear a previously set timeout", function() {
|
309
|
-
var clearedFn = jasmine.createSpy('clearedFn'),
|
310
|
-
delayedFunctionScheduler = new j$.DelayedFunctionScheduler(),
|
311
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
312
|
-
clock = new j$.Clock({setTimeout: function() {}}, delayedFunctionScheduler, mockDate),
|
313
|
-
timeoutId;
|
314
|
-
|
315
|
-
clock.install();
|
316
|
-
|
317
|
-
timeoutId = clock.setTimeout(clearedFn, 100);
|
318
|
-
expect(clearedFn).not.toHaveBeenCalled();
|
319
|
-
|
320
|
-
clock.clearTimeout(timeoutId);
|
321
|
-
clock.tick(100);
|
322
|
-
|
323
|
-
expect(clearedFn).not.toHaveBeenCalled();
|
324
|
-
});
|
325
|
-
|
326
|
-
it("correctly schedules functions after the Clock has advanced", function() {
|
327
|
-
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
328
|
-
delayedFunctionScheduler = new j$.DelayedFunctionScheduler(),
|
329
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
330
|
-
clock = new j$.Clock({setTimeout: function() {}}, delayedFunctionScheduler, mockDate);
|
331
|
-
|
332
|
-
clock.install();
|
333
|
-
|
334
|
-
clock.tick(100);
|
335
|
-
clock.setTimeout(delayedFn1, 10, ['some', 'arg']);
|
336
|
-
clock.tick(5);
|
337
|
-
expect(delayedFn1).not.toHaveBeenCalled();
|
338
|
-
clock.tick(5);
|
339
|
-
expect(delayedFn1).toHaveBeenCalled();
|
340
|
-
});
|
341
|
-
|
342
|
-
it("correctly schedules functions while the Clock is advancing", function() {
|
343
|
-
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
344
|
-
delayedFn2 = jasmine.createSpy('delayedFn2'),
|
345
|
-
delayedFunctionScheduler = new j$.DelayedFunctionScheduler(),
|
346
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
347
|
-
clock = new j$.Clock({setTimeout: function() {}}, delayedFunctionScheduler, mockDate);
|
348
|
-
|
349
|
-
delayedFn1.and.callFake(function() { clock.setTimeout(delayedFn2, 0); });
|
350
|
-
clock.install();
|
351
|
-
clock.setTimeout(delayedFn1, 5);
|
352
|
-
|
353
|
-
clock.tick(5);
|
354
|
-
expect(delayedFn1).toHaveBeenCalled();
|
355
|
-
expect(delayedFn2).not.toHaveBeenCalled();
|
356
|
-
|
357
|
-
clock.tick();
|
358
|
-
expect(delayedFn2).toHaveBeenCalled();
|
359
|
-
});
|
360
|
-
|
361
|
-
it("correctly calls functions scheduled while the Clock is advancing", function() {
|
362
|
-
var delayedFn1 = jasmine.createSpy('delayedFn1'),
|
363
|
-
delayedFn2 = jasmine.createSpy('delayedFn2'),
|
364
|
-
delayedFunctionScheduler = new j$.DelayedFunctionScheduler(),
|
365
|
-
mockDate = { install: function() {}, tick: function() {}, uninstall: function() {} },
|
366
|
-
clock = new j$.Clock({setTimeout: function() {}}, delayedFunctionScheduler, mockDate);
|
367
|
-
|
368
|
-
delayedFn1.and.callFake(function() { clock.setTimeout(delayedFn2, 1); });
|
369
|
-
clock.install();
|
370
|
-
clock.setTimeout(delayedFn1, 5);
|
371
|
-
|
372
|
-
clock.tick(6);
|
373
|
-
expect(delayedFn1).toHaveBeenCalled();
|
374
|
-
expect(delayedFn2).toHaveBeenCalled();
|
375
|
-
});
|
376
|
-
|
377
|
-
it("does not mock the Date object by default", function() {
|
378
|
-
var delayedFunctionScheduler = new j$.DelayedFunctionScheduler(),
|
379
|
-
global = {Date: Date},
|
380
|
-
mockDate = new j$.MockDate(global),
|
381
|
-
clock = new j$.Clock({setTimeout: setTimeout}, delayedFunctionScheduler, mockDate);
|
382
|
-
|
383
|
-
clock.install();
|
384
|
-
|
385
|
-
expect(global.Date).toEqual(Date);
|
386
|
-
|
387
|
-
var now = new global.Date().getTime();
|
388
|
-
|
389
|
-
clock.tick(50);
|
390
|
-
|
391
|
-
expect(new global.Date().getTime() - now).not.toEqual(50);
|
392
|
-
});
|
393
|
-
|
394
|
-
it("mocks the Date object and sets it to current time", function() {
|
395
|
-
var delayedFunctionScheduler = new j$.DelayedFunctionScheduler(),
|
396
|
-
global = {Date: Date},
|
397
|
-
mockDate = new j$.MockDate(global),
|
398
|
-
clock = new j$.Clock({setTimeout: setTimeout}, delayedFunctionScheduler, mockDate);
|
399
|
-
|
400
|
-
clock.install().mockDate();
|
401
|
-
|
402
|
-
var now = new global.Date().getTime();
|
403
|
-
|
404
|
-
clock.tick(50);
|
405
|
-
|
406
|
-
expect(new global.Date().getTime() - now).toEqual(50);
|
407
|
-
|
408
|
-
var timeoutDate = 0;
|
409
|
-
clock.setTimeout(function() {
|
410
|
-
timeoutDate = new global.Date().getTime();
|
411
|
-
}, 100);
|
412
|
-
|
413
|
-
clock.tick(100);
|
414
|
-
|
415
|
-
expect(timeoutDate - now).toEqual(150);
|
416
|
-
});
|
417
|
-
|
418
|
-
it("mocks the Date object and sets it to a given time", function() {
|
419
|
-
var delayedFunctionScheduler = new j$.DelayedFunctionScheduler(),
|
420
|
-
global = {Date: Date},
|
421
|
-
mockDate = new j$.MockDate(global),
|
422
|
-
clock = new j$.Clock({setTimeout: setTimeout}, delayedFunctionScheduler, mockDate),
|
423
|
-
baseTime = new Date(2013, 9, 23);
|
424
|
-
|
425
|
-
|
426
|
-
clock.install().mockDate(baseTime);
|
427
|
-
|
428
|
-
var now = new global.Date().getTime();
|
429
|
-
|
430
|
-
expect(now).toEqual(baseTime.getTime());
|
431
|
-
|
432
|
-
clock.tick(50);
|
433
|
-
|
434
|
-
expect(new global.Date().getTime()).toEqual(baseTime.getTime() + 50);
|
435
|
-
|
436
|
-
var timeoutDate = 0;
|
437
|
-
clock.setTimeout(function() {
|
438
|
-
timeoutDate = new global.Date().getTime();
|
439
|
-
}, 100);
|
440
|
-
|
441
|
-
clock.tick(100);
|
442
|
-
|
443
|
-
expect(timeoutDate).toEqual(baseTime.getTime() + 150);
|
444
|
-
});
|
445
|
-
});
|
data/spec_app/vendor/assets/bower_components/jasmine/spec/core/DelayedFunctionSchedulerSpec.js
DELETED
@@ -1,246 +0,0 @@
|
|
1
|
-
describe("DelayedFunctionScheduler", function() {
|
2
|
-
it("schedules a function for later execution", function() {
|
3
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
4
|
-
fn = jasmine.createSpy('fn');
|
5
|
-
|
6
|
-
scheduler.scheduleFunction(fn, 0);
|
7
|
-
|
8
|
-
expect(fn).not.toHaveBeenCalled();
|
9
|
-
|
10
|
-
scheduler.tick(0);
|
11
|
-
|
12
|
-
expect(fn).toHaveBeenCalled();
|
13
|
-
});
|
14
|
-
|
15
|
-
it("schedules a string for later execution", function() {
|
16
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
17
|
-
strfn = "horrible = true;";
|
18
|
-
|
19
|
-
scheduler.scheduleFunction(strfn, 0);
|
20
|
-
|
21
|
-
scheduler.tick(0);
|
22
|
-
|
23
|
-
expect(horrible).toEqual(true);
|
24
|
-
});
|
25
|
-
|
26
|
-
it("#tick defaults to 0", function() {
|
27
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
28
|
-
fn = jasmine.createSpy('fn');
|
29
|
-
|
30
|
-
scheduler.scheduleFunction(fn, 0);
|
31
|
-
|
32
|
-
expect(fn).not.toHaveBeenCalled();
|
33
|
-
|
34
|
-
scheduler.tick();
|
35
|
-
|
36
|
-
expect(fn).toHaveBeenCalled();
|
37
|
-
});
|
38
|
-
|
39
|
-
it("defaults delay to 0", function() {
|
40
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
41
|
-
fn = jasmine.createSpy('fn');
|
42
|
-
|
43
|
-
scheduler.scheduleFunction(fn);
|
44
|
-
|
45
|
-
expect(fn).not.toHaveBeenCalled();
|
46
|
-
|
47
|
-
scheduler.tick(0);
|
48
|
-
|
49
|
-
expect(fn).toHaveBeenCalled();
|
50
|
-
});
|
51
|
-
|
52
|
-
it("optionally passes params to scheduled functions", function() {
|
53
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
54
|
-
fn = jasmine.createSpy('fn');
|
55
|
-
|
56
|
-
scheduler.scheduleFunction(fn, 0, ['foo', 'bar']);
|
57
|
-
|
58
|
-
expect(fn).not.toHaveBeenCalled();
|
59
|
-
|
60
|
-
scheduler.tick(0);
|
61
|
-
|
62
|
-
expect(fn).toHaveBeenCalledWith('foo', 'bar');
|
63
|
-
});
|
64
|
-
|
65
|
-
it("scheduled fns can optionally reoccur", function() {
|
66
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
67
|
-
fn = jasmine.createSpy('fn');
|
68
|
-
|
69
|
-
scheduler.scheduleFunction(fn, 20, [], true);
|
70
|
-
|
71
|
-
expect(fn).not.toHaveBeenCalled();
|
72
|
-
|
73
|
-
scheduler.tick(20);
|
74
|
-
|
75
|
-
expect(fn.calls.count()).toBe(1);
|
76
|
-
|
77
|
-
scheduler.tick(40);
|
78
|
-
|
79
|
-
expect(fn.calls.count()).toBe(3);
|
80
|
-
|
81
|
-
scheduler.tick(21);
|
82
|
-
|
83
|
-
expect(fn.calls.count()).toBe(4);
|
84
|
-
|
85
|
-
});
|
86
|
-
|
87
|
-
it("increments scheduled fns ids unless one is passed", function() {
|
88
|
-
var scheduler = new j$.DelayedFunctionScheduler();
|
89
|
-
|
90
|
-
expect(scheduler.scheduleFunction(function() {
|
91
|
-
}, 0)).toBe(1);
|
92
|
-
expect(scheduler.scheduleFunction(function() {
|
93
|
-
}, 0)).toBe(2);
|
94
|
-
expect(scheduler.scheduleFunction(function() {
|
95
|
-
}, 0, [], false, 123)).toBe(123);
|
96
|
-
expect(scheduler.scheduleFunction(function() {
|
97
|
-
}, 0)).toBe(3);
|
98
|
-
});
|
99
|
-
|
100
|
-
it("#removeFunctionWithId removes a previously scheduled function with a given id", function() {
|
101
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
102
|
-
fn = jasmine.createSpy('fn'),
|
103
|
-
timeoutKey;
|
104
|
-
|
105
|
-
timeoutKey = scheduler.scheduleFunction(fn, 0);
|
106
|
-
|
107
|
-
expect(fn).not.toHaveBeenCalled();
|
108
|
-
|
109
|
-
scheduler.removeFunctionWithId(timeoutKey);
|
110
|
-
|
111
|
-
scheduler.tick(0);
|
112
|
-
|
113
|
-
expect(fn).not.toHaveBeenCalled();
|
114
|
-
});
|
115
|
-
|
116
|
-
it("reset removes scheduled functions", function() {
|
117
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
118
|
-
fn = jasmine.createSpy('fn');
|
119
|
-
|
120
|
-
scheduler.scheduleFunction(fn, 0);
|
121
|
-
|
122
|
-
expect(fn).not.toHaveBeenCalled();
|
123
|
-
|
124
|
-
scheduler.reset();
|
125
|
-
|
126
|
-
scheduler.tick(0);
|
127
|
-
|
128
|
-
expect(fn).not.toHaveBeenCalled();
|
129
|
-
});
|
130
|
-
|
131
|
-
it("reset resets the returned ids", function() {
|
132
|
-
var scheduler = new j$.DelayedFunctionScheduler();
|
133
|
-
expect(scheduler.scheduleFunction(function() { }, 0)).toBe(1);
|
134
|
-
expect(scheduler.scheduleFunction(function() { }, 0, [], false, 123)).toBe(123);
|
135
|
-
|
136
|
-
scheduler.reset();
|
137
|
-
expect(scheduler.scheduleFunction(function() { }, 0)).toBe(1);
|
138
|
-
expect(scheduler.scheduleFunction(function() { }, 0, [], false, 123)).toBe(123);
|
139
|
-
});
|
140
|
-
|
141
|
-
it("reset resets the current tick time", function() {
|
142
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
143
|
-
fn = jasmine.createSpy('fn');
|
144
|
-
|
145
|
-
expect(fn).not.toHaveBeenCalled();
|
146
|
-
|
147
|
-
scheduler.tick(15);
|
148
|
-
scheduler.reset();
|
149
|
-
|
150
|
-
scheduler.scheduleFunction(fn, 20, [], false, 1, 20);
|
151
|
-
|
152
|
-
scheduler.tick(5);
|
153
|
-
|
154
|
-
expect(fn).not.toHaveBeenCalled();
|
155
|
-
});
|
156
|
-
|
157
|
-
it("executes recurring functions interleaved with regular functions in the correct order", function() {
|
158
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
159
|
-
fn = jasmine.createSpy('fn'),
|
160
|
-
recurringCallCount = 0,
|
161
|
-
recurring = jasmine.createSpy('recurring').and.callFake(function() {
|
162
|
-
recurringCallCount++;
|
163
|
-
if (recurringCallCount < 5) {
|
164
|
-
expect(fn).not.toHaveBeenCalled();
|
165
|
-
}
|
166
|
-
});
|
167
|
-
|
168
|
-
scheduler.scheduleFunction(recurring, 10, [], true);
|
169
|
-
scheduler.scheduleFunction(fn, 50);
|
170
|
-
|
171
|
-
scheduler.tick(60);
|
172
|
-
|
173
|
-
expect(recurring).toHaveBeenCalled();
|
174
|
-
expect(recurring.calls.count()).toBe(6);
|
175
|
-
expect(fn).toHaveBeenCalled();
|
176
|
-
});
|
177
|
-
|
178
|
-
it("schedules a function for later execution during a tick", function () {
|
179
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
180
|
-
fn = jasmine.createSpy('fn'),
|
181
|
-
fnDelay = 10;
|
182
|
-
|
183
|
-
scheduler.scheduleFunction(function () {
|
184
|
-
scheduler.scheduleFunction(fn, fnDelay);
|
185
|
-
}, 0);
|
186
|
-
|
187
|
-
expect(fn).not.toHaveBeenCalled();
|
188
|
-
|
189
|
-
scheduler.tick(fnDelay);
|
190
|
-
|
191
|
-
expect(fn).toHaveBeenCalled();
|
192
|
-
});
|
193
|
-
|
194
|
-
it("#removeFunctionWithId removes a previously scheduled function with a given id during a tick", function () {
|
195
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
196
|
-
fn = jasmine.createSpy('fn'),
|
197
|
-
fnDelay = 10,
|
198
|
-
timeoutKey;
|
199
|
-
|
200
|
-
scheduler.scheduleFunction(function () {
|
201
|
-
scheduler.removeFunctionWithId(timeoutKey);
|
202
|
-
}, 0);
|
203
|
-
timeoutKey = scheduler.scheduleFunction(fn, fnDelay);
|
204
|
-
|
205
|
-
expect(fn).not.toHaveBeenCalled();
|
206
|
-
|
207
|
-
scheduler.tick(fnDelay);
|
208
|
-
|
209
|
-
expect(fn).not.toHaveBeenCalled();
|
210
|
-
});
|
211
|
-
|
212
|
-
it("executes recurring functions interleaved with regular functions and functions scheduled during a tick in the correct order", function () {
|
213
|
-
var scheduler = new j$.DelayedFunctionScheduler(),
|
214
|
-
fn = jasmine.createSpy('fn'),
|
215
|
-
recurringCallCount = 0,
|
216
|
-
recurring = jasmine.createSpy('recurring').and.callFake(function() {
|
217
|
-
recurringCallCount++;
|
218
|
-
if (recurringCallCount < 5) {
|
219
|
-
expect(fn).not.toHaveBeenCalled();
|
220
|
-
}
|
221
|
-
}),
|
222
|
-
innerFn = jasmine.createSpy('innerFn').and.callFake(function() {
|
223
|
-
expect(recurring.calls.count()).toBe(4);
|
224
|
-
expect(fn).not.toHaveBeenCalled();
|
225
|
-
}),
|
226
|
-
scheduling = jasmine.createSpy('scheduling').and.callFake(function() {
|
227
|
-
expect(recurring.calls.count()).toBe(3);
|
228
|
-
expect(fn).not.toHaveBeenCalled();
|
229
|
-
scheduler.scheduleFunction(innerFn, 10); // 41ms absolute
|
230
|
-
});
|
231
|
-
|
232
|
-
scheduler.scheduleFunction(recurring, 10, [], true);
|
233
|
-
scheduler.scheduleFunction(fn, 50);
|
234
|
-
scheduler.scheduleFunction(scheduling, 31);
|
235
|
-
|
236
|
-
scheduler.tick(60);
|
237
|
-
|
238
|
-
expect(recurring).toHaveBeenCalled();
|
239
|
-
expect(recurring.calls.count()).toBe(6);
|
240
|
-
expect(fn).toHaveBeenCalled();
|
241
|
-
expect(scheduling).toHaveBeenCalled();
|
242
|
-
expect(innerFn).toHaveBeenCalled();
|
243
|
-
});
|
244
|
-
|
245
|
-
});
|
246
|
-
|