Sha256: 596d695afc5ba202ecdd3f4480c1b1b8d5c1c25859ef40477dd48bddd0cd82b0

Contents?: true

Size: 1.48 KB

Versions: 1

Compression:

Stored size: 1.48 KB

Contents

#= require_tree ../fixtures
#= require ../../../vendor/assets/javascripts/testing/sinon-1.4.2

# FakeHost.respond() to complete request
beforeEach ->
  
  localStorage.clear()
  window.FakeHost = sinon.fakeServer.create();
  #window.FakeHost.respondWith("GET", ShopCompare.routes.course_search_path(),   [200, { "Content-Type": "application/json" }, JSON.stringify( Fixtures.courses )] )
  window.FakeHost.respondWith("GET", new RegExp(ShopCompare.routes.section_books_path("[\\d]+$")), [200, { "Content-Type": "application/json" }, JSON.stringify( Fixtures.section )] )
  window.FakeHost.respondWith("GET", new RegExp(ShopCompare.routes.book_info_path({isbn : "[\\d]+$"})), [200, { "Content-Type": "application/json" }, JSON.stringify( Fixtures.book )] )
  window.FakeHost.respondWith("GET", ShopCompare.escapeRegExp(ShopCompare.offer_route("REG"), "REG", "[\\d]+"), [200, { "Content-Type": "application/json" }, JSON.stringify( Fixtures.offers )] )
  # window.FakeHost.respondWith("GET", /\/applications.json/,   [200, { "Content-Type": "application/json" }, JSON.stringify( Fixtures.rafter_apps )] )
  # window.FakeHost.respondWith("GET", new RegExp(ShopCompare.routes.sections_path() + "\\?keywords=[^&]*$"), [200, { "Content-Type": "application/json" }, JSON.stringify( Fixtures.courses )])
  # window.FakeHost.respondWith("GET", new RegExp(ShopCompare.routes.sections_path()), [200, { "Content-Type": "application/json" }, JSON.stringify( Fixtures.sections )])
  
afterEach ->
  window.FakeHost.restore()

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails-backbone-generator-0.0.1 lib/generators/backbone/templates/spec/javascripts/helpers/fake_host.coffee