This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe "GET /v1/articles" do | |
| let(:articles) { create_list(:article, 25) } | |
| it "returns 3 articles by default" do | |
| # if I don't access `articles` here articles are not created | |
| # eg: puts articles | |
| get '/v1/articles' | |
| puts response.body |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| test("extractArray with embedded objects", function() { | |
| env.container.register('adapter:superVillain', HAL.Adapter); | |
| var json_hash = { | |
| _links: { | |
| self: { | |
| href: "/homePlanets" | |
| } | |
| }, | |
| _embedded: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Route | |
| export default Ember.Route.extend(RouteMixin, { | |
| queryParams: { | |
| tab: { | |
| refreshModel: true | |
| } | |
| }, | |
| model: function(params) { | |
| params.paramMapping = { | |
| perPage: "size" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Error: Assertion Failed: | |
| // A (subclass of DS.Model) record was pushed into the store with the value of comments being 'post/1/comments', | |
| // but comments is a hasMany relationship so the value must be an array. | |
| // You should probably check your data payload or serializer. | |
| test("async hasMany backed by a link always returns a promise", function() { | |
| Post.reopen({ | |
| comments: DS.hasMany('comment', { async: true }) | |
| }); | |
| store.push('post', { id: 1, text: "Some text", comments: 'post/1/comments' }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default class Timer { | |
| constructor(tick) { | |
| this.tick = tick; | |
| } | |
| start() { | |
| this.decreaseCounterLoop(); | |
| } | |
| stop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export·const·SAVE_STATE·=·'SAVE_STATE'; | |
| export·const·CLEAR_STATE·=·'CLEAR_STATE'; | |
| export·const·RESTORE_OPENED_CARDS·=·'RESTORE_OPENED_CARDS'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var superagent = require('superagent'); | |
| var base = 'https://www.letsrevolutionizetesting.com/challenge?id=208550157'; | |
| function challenge(url, cb) { | |
| superagent.get(url) | |
| .set('Accept', 'application/json') | |
| .end(function(err, res) { | |
| cb(err, res); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var source = require('vinyl-source-stream'); | |
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var jshint = require('gulp-jshint'); | |
| var watchify = require('watchify'); | |
| var browserify = require('browserify'); | |
| var uglify = require('gulp-uglify'); | |
| var streamify = require('gulp-streamify'); | |
| var sources = ['./src/main.js']; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var h = require('virtual-dom/h'); | |
| var diff = require('virtual-dom/diff'); | |
| var patch = require('virtual-dom/patch'); | |
| var createElement = require('virtual-dom/create-element'); | |
| const area = [2, 1, 3, 4, 5]; | |
| function renderTile(pos) { | |
| const animation = area[pos]===1?'.animate':''; |