Commit Graph

42 Commits

Author SHA1 Message Date
Peter Leitzen 7b87ed1499 Cleanup usages of `JSON.parse` in specs
Prefer `json_response` where applicable.
2019-07-16 08:03:49 +00:00
Markus Koller 12d7b3937f
Correctly check permissions when creating snippet notes
In the Snippets::NotesController the noteable was resolved and
authorized through the :snippet_id, so by passing a :target_id for a
different snippet it was possible to create a note on a snippet
where the user would be unauthorized to do so otherwise.

This fixes the problem by ignoring the :target_id and :target_type from
the request, and using the same noteable for creation and authorization.
2019-06-06 09:32:18 +02:00
gfyoung 93a44e135b Add some frozen string to spec/**/*.rb
Adds frozen string to the following:

* spec/bin/**/*.rb
* spec/config/**/*.rb
* spec/controllers/**/*.rb

xref https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
2019-04-15 10:17:05 +00:00
Heinrich Lee Yu 3d85406734 Only return `commands_changes` used in frontend
When executing quick actions, this limits the `commands_changes`
response to only those used by the frontend
2019-03-18 13:28:35 -05:00
Heinrich Lee Yu d03dee26b9 Refactor params for notes_actions
Removes unneeded params from permitted list

This also fixes commenting on commits with a hash starting with a large
number
2019-02-23 09:38:58 +08:00
blackst0ne b44a2c801a Update specs to rails5 format
Updates specs to use new rails5 format.

The old format:
`get :show, { some: params }, { some: headers }`

The new format:
`get :show, params: { some: params }, headers: { some: headers }`
2018-12-19 10:04:31 +11:00
Jasper Maes de399c4a49 Fix deprecation: Comparing equality between ActionController::Parameters and a Hash is deprecated 2018-12-16 13:45:19 +01:00
Cindy Pallares e122e14ac6
Merge branch 'security-guest-comments' into 'master'
[master]Fixed ability to comment on and edit/delete comments on locked or confidential issues

See merge request gitlab/gitlabhq!2612
2018-11-28 19:11:56 -05:00
Oswaldo Ferreira 86ead874e2 Resolve "Filter discussion (tab) by comments or activity in issues and merge requests" 2018-10-23 09:49:45 +00:00
Douwe Maan 2036458e15 Return discussion object from NotesController#create when return_discussion param is set 2018-09-21 11:40:57 +01:00
Jan Provaznik d95c1f0335 Use ResourceLabelEvent for tracking label changes 2018-09-07 13:39:20 +00:00
Felipe Artur 3e66795ef1 Changes tab VUE refactoring 2018-06-21 12:22:40 +00:00
blackst0ne 27c95364b5 Replace '.team << [user, role]' with 'add_role(user)' in specs 2017-12-22 19:18:28 +11:00
Douwe Maan f691010d5c Make sure NotesActions#noteable returns a Noteable in the update action 2017-11-16 15:12:23 +01:00
Filipa Lacerda 46dc343f60 Merge branch '38677-render-new-discussions-on-diff-tab' into 'master'
Added discussion_line_code value to note response and use it to query the right…

Closes #38677

See merge request gitlab-org/gitlab-ce!14981
2017-11-06 09:55:02 +00:00
Felipe Artur 3ae5f7900c Render 404 when polling commit notes without having permissions 2017-11-03 11:26:25 -02:00
Luke "Jared" Bennett d635f8bbe1
Improve discussion_line_code set and update notes_controller_spec 2017-10-21 18:16:35 +01:00
Jacopo 2f40dac352 Refactor `have_http_status` into `have_gitlab_http_status` in the specs 2017-10-20 10:13:18 +02:00
Bob Van Landuyt e8ca579d88 Add a project forks spec helper
The helper creates a fork of a project with all provided attributes,
but skipping the creation of the repository on disk.
2017-10-07 11:46:23 +02:00
Sean McGivern a68a39e341 Merge branch '18608-lock-issues-v2' into 'master'
Resolve "Lock issue and merge request"

Closes #18608

See merge request gitlab-org/gitlab-ce!14531
2017-10-06 16:47:27 +00:00
Stan Hu 10096256f1 Improve performance of filtering notes in NotesController
Reduces the number of queries needed to redact notes to which
the user does not have access. Also includes an N+1 query test
as a guard against future issues.

This is a follow-up from https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14327#note_40976854.
2017-10-02 21:48:34 -07:00
Jarka Kadlecova 994e7d1359 Create system notes for MR too, improve doc + clean up code 2017-09-14 14:50:32 +02:00
Jarka Kadlecova 2b82f907ab Check the discussion lock only for issuables & clean style 2017-09-14 14:50:32 +02:00
Jarka Kadlecova b928720852 Support discussion locking in the backend 2017-09-14 14:50:32 +02:00
Douwe Maan a540f55c6e Fix specs 2017-08-30 10:43:10 +02:00
Robert Speicher 72a7b30c9f Change all `:empty_project` to `:project` 2017-08-02 17:47:31 -04:00
Robert Speicher 9513bd18c4 Ensure all project factories use `:repository` trait or `:empty_project` 2017-08-01 14:51:52 -04:00
Sean McGivern 75d04f6a29 Fix replying to commit comments on MRs from forks
A commit comment shows in the MR, but if the MR is from a fork, it will have a
different project ID to the MR's target project. In that case, add an
note_project_id param so that we can pick the correct project for the note.
2017-07-28 16:25:13 +01:00
Jarka Kadlecova 8c3a03c1b9 Display comments for personal snippets 2017-05-02 13:07:53 +02:00
Douwe Maan 09330dd17c Remove unused code 2017-04-05 12:56:31 -05:00
Douwe Maan 21e10888c3
Address review comments 2017-04-05 17:44:14 +01:00
Douwe Maan 79889a6aa3
Add specs 2017-04-05 17:44:14 +01:00
Douwe Maan 9c30b0e918
Fix some specs 2017-04-05 17:44:14 +01:00
Douwe Maan 08bbb9fce6
Add option to start a new discussion on an MR 2017-04-05 17:44:14 +01:00
Adam Niedzielski 0a31efb577 Remove query parameters from notes polling endpoint to make caching easier 2017-03-01 16:34:28 +01:00
Robert Speicher 4642ca6686 Use `empty_project` where possible in controller specs 2017-01-25 17:14:38 -05:00
Jarka Kadlecova 7ab3dd4b30 support `/merge` slash comand for MRs 2017-01-11 08:48:07 -05:00
Douwe Maan 41007f6d3c Address review feedback 2016-08-16 11:04:26 -05:00
Douwe Maan e257200459 Add specs for NotesController and DiscussionsController 2016-08-12 16:24:09 -05:00
Z.J. van de Weg abca19da8b Use HTTP matchers if possible 2016-06-27 20:10:42 +02:00
Z.J. van de Weg 7d3f8f542f Update tests on wording 2016-06-06 11:10:10 +02:00
ZJ van de Weg 2f9c2149a3 Backend awardables on comments 2016-06-06 11:03:39 +02:00