Commit graph

1474 commits

Author SHA1 Message Date
Tom Hughes
a221aabe3c Check that pluralizable translations have an "other" key 2020-06-11 19:21:41 +01:00
Andy Allan
600812f6ad Rework user#set_status and #delete to avoid GET requests
This renames the delete action to destroy, and starts using resourceful
routing for user actions.
2020-06-10 11:49:18 +02:00
Tom Hughes
d6f518f627 More improvements to locale selection for the data browser
Use the browser language preferences for non-logged in users.
2020-06-07 19:10:48 +01:00
Tom Hughes
293fe68eff Merge remote-tracking branch 'upstream/pull/2642' 2020-06-04 17:40:13 +01:00
Tom Hughes
768a792a61 Improve selection of name to display in data browser
If the user is logged in then consider all their preferred
languages rather than just the UI language, and use the full
locale matching algorithm instead of just checking parents.

Fixes #2636
2020-06-04 17:33:11 +01:00
Tom Hughes
bf22c69286 Improve locale selection algorithm
Don't include locales which only have rails translations in
the candidates, and ensure that user specified options take
priority over less specific variants of earlier choices.
2020-06-04 17:33:11 +01:00
Andy Allan
8ebfdbc1ff Move make_friend and remove_friend to friendships controller 2020-06-03 18:23:07 +02:00
Andy Allan
59c90aa023 Move friendship related tests to separate file 2020-06-03 17:51:11 +02:00
Andy Allan
7485b49a3a Remove unused test helper 2020-05-13 18:15:07 +02:00
Andy Allan
3a16c465f7 Refactor user controller tests
Because we don't have direct access to the session and cookies, some
of the tests need more setup e.g. by moving through the signup process
to get the session tokens into the right place for the confirmation
steps to work.
2020-05-13 18:08:22 +02:00
Andy Allan
36a1f38109 Refactor api traces_controller tests 2020-05-13 18:08:07 +02:00
Tom Hughes
7ffa2e96be Refactor users_controller_test and user_preferences_controller_test 2020-05-07 19:34:48 +01:00
Tom Hughes
2d37f1a03c Refactor notes_controller_test 2020-05-06 18:39:48 +01:00
Tom Hughes
45e560bef6 Add test for browsing a note closed by a deleted user 2020-05-06 18:06:45 +01:00
Andy Allan
f84980f183 More controller test refactoring 2020-05-06 16:51:04 +02:00
Tom Hughes
9a87412d2a Refactor permissions_controller_test 2020-05-05 19:40:52 +01:00
Tom Hughes
c576edecd4 Refactor versions_controller_test 2020-05-05 19:36:38 +01:00
Tom Hughes
93f1489048 Refactor tracepoints_controller_test 2020-05-05 19:28:42 +01:00
Tom Hughes
dbf0147d21 Remove unused function 2020-05-05 19:20:21 +01:00
Tom Hughes
f898cecb5c Refactor map_controller_test 2020-05-05 19:19:43 +01:00
Tom Hughes
6f342c7616 Switch oauth integration tests to use new shared helper 2020-05-05 18:04:48 +01:00
Tom Hughes
7e1a4b6884 Refactor changeset comments API controller tests 2020-05-05 18:04:48 +01:00
Tom Hughes
c18e39cc05 Add helper methods for making OAuth signed requests 2020-05-05 18:04:48 +01:00
Tom Hughes
749ca5d5a0 Refactor the AMF controller API tests 2020-05-05 17:45:46 +01:00
Andy Allan
2e3522a2f6 Refactor changesets_controller_test
Introduces some route names which need to be unique from the non-api versions
2020-04-29 17:42:08 +02:00
Andy Allan
e765a6691b Refactor more controller tests 2020-04-29 17:28:42 +02:00
Tom Hughes
f7d95e2ef9 Refactor traces controller tests 2020-04-28 19:44:00 +01:00
Tom Hughes
f75eb6fe9e Refactor more controller tests 2020-04-27 22:24:28 +01:00
Tom Hughes
8979c597e3 Refactor more controller tests 2020-04-26 22:56:18 +01:00
Tom Hughes
03cde71a5e Refactor more controller tests 2020-04-26 20:33:06 +01:00
Tom Hughes
cca1ce59f4 Merge remote-tracking branch 'upstream/pull/2598' 2020-04-22 16:43:14 +01:00
Andy Allan
506731031d Refactor some more controller tests 2020-04-22 16:45:16 +02:00
Tom Hughes
8773ec6e57 Switch to using selenium for system tests 2020-04-22 13:51:37 +01:00
Tom Hughes
c51786d10b Merge remote-tracking branch 'upstream/pull/2596' 2020-04-22 13:44:17 +01:00
Tom Hughes
359d76c8f0 Redirect to the error page for non-existent issues 2020-04-22 12:37:56 +01:00
Andy Allan
1aa5a54419 Refactor site controller tests to inherit from ActionDispatch::IntegrationTest
This is the modern way of writing controller tests, since it uses the
rails middleware (among other things) and leads to more realistic tests.

Refs #2563
2020-04-22 11:09:13 +02:00
Tom Hughes
ef147d479e Fix new rubocop warnings 2020-04-19 19:06:07 +01:00
Tom Hughes
7a1615bc55 Fix rubocop-minitest warnings 2020-04-15 19:07:13 +01:00
Andy Allan
a219df24ca Ensure that urls are only valid if the entire string is a url
This replaces our homegrown regexps (that didn't quite work) with
ruby built-in regexps, and uses the termination anchor to ensure
that the entire string, not just the first part, is validated.
2020-04-01 17:53:37 +02:00
Tom Hughes
e47c11c644 Merge remote-tracking branch 'upstream/pull/2577' 2020-04-01 11:56:27 +01:00
Andy Allan
055a976051 Remove custom table styling
This removes the custom table styling code, and move to using bootstrap table styling for almost all remaining tables.
2020-04-01 12:29:01 +02:00
Tom Hughes
0e902b5424 Set QT_QPA_PLATFORM=offscreen for Ubuntu etc
Fixes #2569
2020-03-25 17:04:44 +00:00
Tom Hughes
e693063fa5 Make linkify return an HTML safe result for unsafe inputs
Fixes #2567
2020-03-22 12:59:39 +00:00
Andy Allan
1cb0767e3d Copy trace fixture files, rather than symlinking
Since we are using tmpdirs in order to enable parallel testing, we
can go the full hog and drop the fakefs too and just copy all the
files directly into the tmpdir. If a test makes changes (e.g.
changing the icon file during an import) the copy in the tmpdir is
thrown away at the end of the test anyway.
2020-03-18 15:35:55 +01:00
Andy Allan
0e612ea99a Remove unused directories 2020-03-18 15:04:18 +01:00
Andy Allan
6bd6cbd203 Enable parallel tests 2020-03-18 15:04:18 +01:00
Andy Allan
979a474c68 Use unique test directories for each trace test
This allows tests to be run in parallel, since it avoids deleting
some of the symlinks that other tests expect to be there.
2020-03-18 15:04:18 +01:00
Andy Allan
8407c0dd98 Use the settings for the destination of the gpx fixture symlinks
This lets us change the settings values and have the fixtures appear
in the right place.
2020-03-18 14:58:48 +01:00
Andy Allan
5fdada204c Use bootstrap table striping to replace hand-cycled table stripes
This cuts down on the complexity of having to use the `cycle` function
and makes the templates easier to read. CSS-based striping has been
around for many years.

The CSS is in order to keep our custom colour for striped tables.
2020-03-18 12:14:24 +01:00
Tom Hughes
06122fc090 Enforce restrictions on issue visibility properly 2020-03-01 19:20:18 +00:00