Commit graph

54 commits

Author SHA1 Message Date
Anton Khorev
090ccf2b63 Test showing note by suspended user with comment by other user 2025-02-06 22:45:31 +03:00
Tom Hughes
49dfae87ab Add a test for viewing a note opened by a deleted user 2025-02-06 17:08:22 +00:00
Emin Kocan
738e66afa6 Add status filter to user's note page 2024-11-18 15:21:55 +01:00
Andy Allan
ffda8d7ac5
Merge pull request #4680 from tomhughes/validate-page-numbers
Add parameter validation to pagination
2024-05-15 17:43:04 +01:00
Anton Khorev
822466c6c6 Add warnings when creating notes anonymously 2024-05-14 19:42:59 +03:00
Anton Khorev
f554e14b7f Use common sidebar_browse_check in notes controller test 2024-05-01 13:21:24 +03:00
Anton Khorev
eaacfbb911 Restore constraints on note id parameter 2024-05-01 13:17:14 +03:00
Tom Hughes
5d887a37bf Add validation for page number passed to notes#index 2024-04-11 10:08:20 +01:00
Anton Khorev
23e00dc4c7 Shorten note path helper calls in tests 2024-03-24 17:19:05 +03:00
Anton Khorev
b8f5a495f2 Simplify remaining link_to ... user_path in views 2024-03-21 18:07:56 +03:00
Anton Khorev
fa00a38664 Shorten user path helper calls in tests 2024-03-19 07:07:00 +03:00
Anton Khorev
0b901889da Count only tbody rows when testing tables 2024-03-18 01:31:12 +03:00
Anton Khorev
1efbdb2d6c Add closed_by attribute to :closed note factory trait 2024-01-05 13:04:06 +03:00
Andy Allan
9748ce301c Move browse#note to notes#show
This allows a more resourceful routing approach.
2023-02-01 17:13:41 +00:00
Andy Allan
b5046fdcd0 Move browse#new_note to notes#new
This allows a more resourceful routing approach.
2023-02-01 17:13:41 +00:00
Harry Wood
de8ee536b1 Display no notes message when empty
Display a 'No notes' message when there are no notes to display, rather than an empty table with pagination features.
2021-04-09 19:21:09 +01:00
Andy Allan
41d6f19a6b Rename the notes#mine action to index 2020-07-08 18:43:30 +02:00
Tom Hughes
8979c597e3 Refactor more controller tests 2020-04-26 22:56:18 +01:00
Tom Hughes
e219916dcb When overriding setup make sure to call the superclass 2019-09-05 21:24:20 +01:00
Andy Allan
b4dbf6233c Move the notes api methods into a controller in the api namespace 2019-02-28 17:12:28 +01:00
Andy Allan
b54362d458 Use deliver_later for all email sending 2018-10-31 16:38:12 +01:00
Tom Hughes
db13180c70 Use "user" as user id parameter for notes searches 2018-10-11 18:30:53 +01:00
ENT8R
e8cb7ac8f1
Add some more tests, better error handling for dates 2018-08-27 16:44:46 +02:00
ENT8R
5f1f8f3c91
Add some more tests 2018-08-26 19:06:01 +02:00
ENT8R
98402908b0
Improve code style, fix tests 2018-08-26 16:04:09 +02:00
Frederik Ramm
b9f9d9df88 allow moderators to read hidden notes through API 2018-07-22 15:42:14 +02:00
Tom Hughes
90d5d062f5 Fix nominatim stubs 2018-07-10 18:50:29 +01:00
Andy Allan
6fe5d42100 Standardise on basic_authorization without the parentheses 2017-07-12 14:36:17 +01:00
Tom Hughes
fe1e28b4f4 Fix more parameter sanitisation issues and add tests 2017-06-29 20:52:57 +01:00
Tom Hughes
3893fd72a9 Fix some tests for changes in rails 5 2017-06-27 08:26:44 +01:00
Tom Hughes
03408b6294 Update get/post etc to remove use of deprecated syntax 2017-06-27 08:26:44 +01:00
Tom Hughes
7c9229fbfc Throw an exception if adding a note comment fails 2017-03-13 14:49:16 +00:00
Tom Hughes
1a5161a9c8 Remove a few unnecessary attributes from moderator users 2017-02-22 18:30:47 +00:00
Andy Allan
91f3339b6a Make all factory-generated users 'normal'
The use of create(:normal_user) makes the tests needlessly harder to
understand and reason about, particularly when we start using
associations in the factories.
2017-02-22 18:26:03 +00:00
Andy Allan
f4835594b6 Convert notes_controller tests to user factories. 2017-02-22 11:33:50 +00:00
Tom Hughes
34c473f503 Use only_path instead of setting an explicit host 2016-11-24 20:33:36 +00:00
Tom Hughes
b8c80bae2d Stub nominatim for reverse lookups in note tests 2016-11-09 22:07:42 +00:00
Andy Allan
feb3b03227 Use model relations when creating objects from factories
Rather than passing around record ids explicitly, we can use the
model relations and pass around the models. This makes reading the
tests slightly simpler to read.
2016-10-19 11:32:08 +01:00
Tom Hughes
c2e12ed77d Add a note_with_comments factory 2016-10-10 15:08:11 +01:00
Andy Allan
c302174b0c Update notes_controller_test to use note and note_comment factories
I've ported across the naming for each note from the old fixture names.
This helps in the mega-tests where multiple notes are tested at the
same time.

The number or results have changed in some tests, since there's little
point in creating e.g. 5 note comments when 2 is enough to test the
functionality.
2016-10-06 09:15:47 +01:00
Tom Hughes
c9fdd5d3cb Don't send note comment notifications to deleted users 2015-10-30 19:20:36 +00:00
Tom Hughes
5dc3e5b48a Don't show hidden notes to non-moderators in the user notes list
Fixes #921
2015-08-12 17:42:14 +01:00
Tom Hughes
1b6c214ab5 Add tests for new note GPX elements 2015-08-10 19:19:23 +01:00
Markus Heidelberg
166dc76ae9 Make notes GPX valid and add useful official elements
The "creator" attribute is required and "extensions" is the correct
name of this element.

Validated with SAXCount from the xerces-c package:

$ SAXCount -v=always -n -s -f notes.gpx

Original error messages:

    Error at file /home/markus/notes.gpx, line 2, char 171
      Message: no declaration found for element 'gpx'

    Error at file /home/markus/notes.gpx, line 2, char 171
      Message: attribute 'version' is not declared for element 'gpx'

After adding the "xmlns" attribute:

    Error at file /home/markus/notes.gpx, line 2, char 213
      Message: missing required attribute 'creator'

    Error at file /home/markus/notes.gpx, line 18, char 14
      Message: no declaration found for element 'extension'

    Error at file /home/markus/notes.gpx, line 26, char 7
      Message: element 'extension' is not allowed for content model '(ele?,time?,magvar?,geoidheight?,name?,cmt?,desc?,src?,link*,sym?,type?,fix?,sat?,hdop?,vdop?,pdop?,ageofdgpsdata?,dgpsid?,extensions?)'

The current errors now are caused by the missing XML schema for the
extensions.

Also add the time, name and link elements.
2015-08-10 19:11:18 +01:00
Tom Hughes
93fb360a08 Add a few more tests 2015-03-07 00:50:35 +00:00
Tom Hughes
77e8a16a15 Avoid relying on the order in which emails are sent 2015-03-05 00:16:26 +00:00
Tom Hughes
21d60e359a Tests! 2015-03-04 21:49:43 +00:00
Tom Hughes
dfc85f089a Test changeset and note comment notification emails 2015-03-02 00:43:07 +00:00
Tom Hughes
a79e6b9342 Load user_roles for permissions 2015-03-02 00:08:46 +00:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00