-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from mvdwg/update-to-json-format-v2
Update to json format and add player in inner route
- Loading branch information
Showing
12 changed files
with
61 additions
and
49 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import buildRoutes from 'ember-engines/routes'; | ||
|
||
export default buildRoutes(function() { | ||
this.route('stories', { path: '/' }); | ||
this.route('stories', { path: '/' }, function() { | ||
this.route('story', { path: ':testId' }); | ||
}); | ||
}); |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import Ember from 'ember'; | ||
|
||
function findModuleAndTest(features, id) { | ||
let test; | ||
let i = -1; | ||
|
||
while (!test && features[++i]) { | ||
test = Ember.A(features[i].tests).findBy('id', id); | ||
} | ||
|
||
if (test) { | ||
return { module: features[i].module, test: test.name }; | ||
} | ||
} | ||
|
||
export default Ember.Route.extend({ | ||
model(params) { | ||
let model = findModuleAndTest(this.modelFor('stories'), params.testId); | ||
|
||
return model; | ||
}, | ||
|
||
setupController(controller, model) { | ||
controller.set('url', `/tests/index.html?tellingStories&module=${encodeURIComponent(model.module)}&filter=${encodeURIComponent(model.test)}`); | ||
} | ||
}); |
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<iframe class="ts-player" id="tsplayer" name="tsplayer" src={{url}}></iframe> |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,28 @@ | ||
[ | ||
{ | ||
"name": "Acceptance | favorites", | ||
"module": "Acceptance | favorites", | ||
"tests": [ | ||
"User favorites email from inbox", | ||
"User favorites email from sent" | ||
{ | ||
"id": "12345", | ||
"name": "User favorites email from inbox" | ||
}, | ||
{ | ||
"id": "6789", | ||
"name": "User favorites email from sent" | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Acceptance | user writes an email", | ||
"module": "Acceptance | user writes an email", | ||
"tests": [ | ||
"User replies an emaill", | ||
"User writes and send an email from scratch" | ||
{ | ||
"id": "54321", | ||
"name": "User replies an emaill" | ||
}, | ||
{ | ||
"id": "9876", | ||
"name": "User writes and send an email from scratch" | ||
} | ||
] | ||
} | ||
] |