Commit graph

41 commits

Author SHA1 Message Date
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
Tom Hughes
ef7f3d800c Fix most auto-correctable rubocop issues 2015-02-20 08:56:16 +00:00
Tom Hughes
34e3e51456 Cleanup trailing whitespace 2015-02-20 08:56:16 +00:00
Tom Hughes
6af8f8a9e3 Fix invalid CSS selectors 2015-01-10 12:41:09 +00:00
Tom Hughes
98184dfb9c Reorganise tests to match modern rails test layout 2014-02-26 00:13:19 +00:00
Renamed from test/functional/notes_controller_test.rb (Browse further)