Commit graph

25 commits

Author SHA1 Message Date
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)