diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-06-16 21:32:23 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-06-16 21:32:23 +0300 |
commit | 7b18e8c744eefa5e07d98c99fef1d31127c28422 (patch) | |
tree | c8db52c74aeacee63f393e8ce973e7f3cdcc88f3 /spec | |
parent | 280c95fc4a8700ba29fea0d28b39fae60b490fc5 (diff) | |
parent | 8aed815b6e646df52043867edfdfcf4f618c6a87 (diff) |
Merge branch '13525-sane-defaults-for-merge-request-js-class-constructor' into 'master'
Avoid a TypeError when initializing MergeRequest JS class with no arg
## What does this MR do?
Avoid a TypeError when initializing MergeRequest JS class with no arg.
## Are there points in the code the reviewer needs to double check?
No.
## Why was this MR needed?
Without this sane default you would get the following error when you
tried to instantiate a new MergeRequest object with no argument (i.e.
`new MergeRequest();`):
TypeError: undefined is not an object (evaluating 'this.opts.action')
## What are the relevant issue numbers?
Fixes #13525.
## Does this MR meet the acceptance criteria?
- [x] No CHANGELOG since it's a trivial internal change
- [x] Tests
- [x] Added for this feature/bug
- [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !4667
Diffstat (limited to 'spec')
-rw-r--r-- | spec/javascripts/merge_request_spec.js.coffee | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/javascripts/merge_request_spec.js.coffee b/spec/javascripts/merge_request_spec.js.coffee index 22ebc7039d1..3cb67d51c85 100644 --- a/spec/javascripts/merge_request_spec.js.coffee +++ b/spec/javascripts/merge_request_spec.js.coffee @@ -6,7 +6,7 @@ describe 'MergeRequest', -> beforeEach -> fixture.load('merge_requests_show.html') - @merge = new MergeRequest({}) + @merge = new MergeRequest() it 'modifies the Markdown field', -> spyOn(jQuery, 'ajax').and.stub() |