28 Dec '14, 9pm

AngularJSとRuby on Railsで作るCRUDアプリ – (2)Read|クラスメソッドブログ

AngularJSとRuby on Railsで作るCRUDアプリ – (2)Read|クラスメソッドブログ

'use strict'; /* jasmine specs for controllers go here */ describe('AngularjsWhiskyList controllers', function() { beforeEach(module('whiskiesListApp')); describe('WhiskiesCtrl', function(){ var scope, httpBackend; beforeEach(inject(function ($rootScope, $controller, $httpBackend, $http) { scope = $rootScope.$new(); httpBackend = $httpBackend; httpBackend.when("GET", "whiskies/list").respond([ {name:'Laphroaig Quarter Cask', price:49.99}, {name:'Johnnie Walker Black', price:33.97}, {name:'Canadian Club', price:19.99} ]); $controller('WhiskiesCtrl', { $scope: scope, $http: $http }); })); it('should get "data" model', function () { httpBackend.flush(); expect(scope.data.length).toBe(3); expect(scope.data[0].name).toBe('Laphroaig Quarter Cask'); expect(scope.data[0].price).toBe(49.99); }); }); });

Full article: http://dev.classmethod.jp/client-side/javascript/angularj...

Tweets

19559 Dress - Black (2 Sizes)

vividoll.com 03 Jan '15, 1pm

I like that the measurements of the outfits are listed so it helps me to find the right fit for me. The delivery was equal...

Golf video tips: how to read greens

Golf video tips: how to read greens

golf-monthly.co.uk 29 Dec '14, 7am

How to improve your swing plane How to play the lofted pitch Three ways to improve your shoulder turn How to shape your go...