diff options
author | Denys Mishunov <dmishunov@gitlab.com> | 2019-03-26 16:23:15 +0100 |
---|---|---|
committer | Denys Mishunov <dmishunov@gitlab.com> | 2019-04-04 09:05:50 +0200 |
commit | f6a038b38ae6c256fb9d1f1cbe184b0d8bbb5fde (patch) | |
tree | fcaf76fdc49cea23edff1a8bfcf11d11b67d57df /spec/javascripts/ide | |
parent | d0a0d3d3d5043d1497a5cd42e6c6bc073f6a5b58 (diff) | |
download | gitlab-ce-f6a038b38ae6c256fb9d1f1cbe184b0d8bbb5fde.tar.gz |
Create a new file if URL references non-existent one
Diffstat (limited to 'spec/javascripts/ide')
-rw-r--r-- | spec/javascripts/ide/stores/actions/project_spec.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/javascripts/ide/stores/actions/project_spec.js b/spec/javascripts/ide/stores/actions/project_spec.js index 7b0963713fb..cd519eaed7c 100644 --- a/spec/javascripts/ide/stores/actions/project_spec.js +++ b/spec/javascripts/ide/stores/actions/project_spec.js @@ -279,5 +279,22 @@ describe('IDE store project actions', () => { .then(done) .catch(done.fail); }); + + it('creates a new file supplied via URL if the file does not exist yet', done => { + openBranch(store, { ...branch, basePath: 'not-existent.md' }) + .then(() => { + expect(store.dispatch).not.toHaveBeenCalledWith( + 'handleTreeEntryAction', + jasmine.anything(), + ); + + expect(store.dispatch).toHaveBeenCalledWith('createTempEntry', { + name: 'not-existent.md', + type: 'blob', + }); + }) + .then(done) + .catch(done.fail); + }); }); }); |