diff --git a/mirage/config.js b/mirage/config.js index 468131b8..2f97c285 100644 --- a/mirage/config.js +++ b/mirage/config.js @@ -37,13 +37,15 @@ export default function() { return turnIntoV3('repository', repos[0]); }); this.get('/jobs/:id', function(schema, request) { - return {job: schema.job.find(request.params.id).attrs, commit: schema.commit.all()[0].attrs}; + let job = schema.job.find(request.params.id).attrs; + return {job: job, commit: schema.commit.find(job.commit_id).attrs}; }); this.get('/jobs', function(schema, request) { return {jobs: schema.job.all()}; }); this.get('/builds/:id', function(schema, request) { - return {build: schema.build.find(request.params.id).attrs, commit: schema.commit.all()[0].attrs}; + let build = schema.build.find(request.params.id).attrs; + return {build: build, commit: schema.commit.find(build.commit_id).attrs}; }); this.get('/jobs/:id/log', function(schema, request) { let log = schema.log.find(request.params.id); @@ -55,10 +57,6 @@ export default function() { } }); - this.get('/v3/repos', function(db, request) { - return turnIntoV3('repository', db.repositories); - }); - // These comments are here to help you get started. Feel free to delete them. /* diff --git a/tests/unit/components/travis-status-test.js b/tests/unit/components/travis-status-test.js index 19fc7962..7626cfbc 100644 --- a/tests/unit/components/travis-status-test.js +++ b/tests/unit/components/travis-status-test.js @@ -1,8 +1,6 @@ import { test, moduleForComponent } from 'ember-qunit'; import Ember from 'ember'; -var server = null; - moduleForComponent('travis-status', 'TravisStatusComponent', { unit: true }); @@ -11,6 +9,7 @@ test('adds incident class to .status-circle', function() { var component; expect(3); component = this.subject(); + component.statusPageStatusUrl = "https://status-url.example.com"; component.getStatus = function() { return new Ember.RSVP.Promise(function(resolve, reject) { return resolve({ @@ -20,6 +19,7 @@ test('adds incident class to .status-circle', function() { }); }); }; + ok(!component.get('status'), 'status is initially not set'); this.render(); equal(component.get('status'), 'major', 'status is updated from the API');