Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/services/ember-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ const availableBlueprints = {
blueprint: 'route',
filePath: 'my-route/route.js',
},
'service': {
blueprint: 'service',
filePath: 'services/my-service.js'
},
'template': {
blueprint: 'template',
filePath: 'my-route/template.hbs',
Expand Down
1 change: 1 addition & 0 deletions app/templates/components/file-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<li><a {{action 'addFile' 'controller'}}>Controller</a></li>
<li><a {{action 'addFile' 'route'}}>Route</a></li>
<li><a {{action 'addFile' 'template'}} class="test-template-action">Template</a></li>
<li><a {{action 'addFile' 'service'}} class="add-service-link">Service</a></li>
<li><a {{action 'addFile' 'router'}}>Router</a></li>
<li><a {{action 'addFile' 'css'}}>CSS</a></li>
</ul>
Expand Down
7 changes: 4 additions & 3 deletions ember-cli-build.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ function getEmberCLIBlueprints() {
var cliPath = 'node_modules/ember-cli';
var cliBlueprintFiles = {
'app': 'app/files/app/app.js',
'router': 'app/files/app/router.js',
'component-js': 'component/files/__root__/__path__/__name__.js',
'component-hbs': 'component/files/__root__/__templatepath__/__templatename__.hbs',
'component-js': 'component/files/__root__/__path__/__name__.js',
'controller': 'controller/files/__root__/__path__/__name__.js',
'model': 'model/files/__root__/__path__/__name__.js',
'route': 'route/files/__root__/__path__/__name__.js',
'controller': 'controller/files/__root__/__path__/__name__.js',
'router': 'app/files/app/router.js',
'service': 'service/files/__root__/__path__/__name__.js',
'template': 'template/files/__root__/__path__/__name__.hbs',
};

Expand Down
26 changes: 26 additions & 0 deletions tests/acceptance/gist-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,32 @@ test('component without hyphen fails', function(assert){
});
});

test('can add service', function(assert){
assert.expect(3);

let origFileCount;
promptValue = "services/my-service.js";
visit('/');
andThen(function(){
origFileCount = find(firstFilePickerFiles).length;
});

click(fileMenu);
click('.add-service-link');
click(firstFilePicker);

andThen(function() {
let numFiles = find(firstFilePickerFiles).length;
assert.equal(numFiles, origFileCount + 1, 'Added service file');

let fileNames = findMapText(`${firstFilePickerFiles} a`);
assert.equal(fileNames[3], promptValue, 'Added the file with the right name');

let columnFiles = findMapText(displayedFiles);
assert.ok(columnFiles.contains(promptValue), 'Added file is displayed');
});
});


test('unsaved indicator', function(assert) {
const indicator = ".test-unsaved-indicator";
Expand Down