Commit graph

29 commits

Author SHA1 Message Date
Tom Hughes
52296d1cad Add rubocop-factory_bot and fix warnings 2023-05-16 18:44:14 +01: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
Anton Khorev
01d48694b4 Don't show 'Download XML' link for deleted elements 2022-09-22 14:51:31 +03:00
Tom Hughes
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
Andy Allan
1a11c4dc19 Use a state machine for user status
The user status is a bit complex, since there are various states and
not all transitions between them make sense.

Using AASM means that we can name and restrict the transitions, which
hopefully makes them easier to reason about.
2022-01-12 18:16:14 +00:00
Andy Allan
a863be8831 Rename User#delete to User#destroy
"delete" is generally used for immediate SQL deletion without running
any callbacks or other ruby code, whereas "destroy" will trigger callbacks.

Although we don't currently use any callbacks, let's rename this method to
align better with the convention.
2021-12-22 11:32:33 +00:00
Tom Hughes
45e560bef6 Add test for browsing a note closed by a deleted user 2020-05-06 18:06:45 +01:00
Tom Hughes
f75eb6fe9e Refactor more controller tests 2020-04-27 22:24:28 +01:00
Tom Hughes
62637645bf Add basic tests for browse#new_note and browse#query 2019-01-09 21:12:33 +00:00
Andy Allan
efa37f6a83 Remove unnecessary require statements from tests 2018-11-07 16:42:11 +01:00
Tom Hughes
5a2d2f97ce Update changeset browse view for renaming of changeset#list to changeset#index 2018-09-09 12:36:34 +01:00
Tom Hughes
6027c42ee7 Hide note comments made by deleted users
Fixes #1970
2018-09-04 22:22:39 +01:00
Tom Hughes
03408b6294 Update get/post etc to remove use of deprecated syntax 2017-06-27 08:26:44 +01:00
Andy Allan
5d0ea28796 Remove the api_fixtures helper
This is no longer required, as the tests no longer use fixtures.
2017-06-01 10:59:48 +01:00
Andy Allan
938786e1ee Refactor various controller tests to use factories. 2017-05-31 14:35:35 +01:00
Andy Allan
0facb801f8 Refactor a few tests to use changeset factories. 2017-05-31 10:45:14 +01:00
Andy Allan
06814eb715 Use node factories for browse_controller tests. 2017-03-30 13:57:30 +01:00
Andy Allan
24cd3af31e Use changeset factory for factory associations
One test needed updating since it assumed the comments were being
created on a particular changeset.
2017-03-22 11:09:52 +00:00
Andy Allan
6335891a4c User factories for browse, oauth_clients and site controller tests. 2017-02-23 14:13:09 +00:00
Andy Allan
a91e50d308 Replace changeset_comments fixtures with a factory.
There's little point in testing ChangesetComment.count so I've removed that
test.
2016-10-12 15:44:27 +01:00
Tom Hughes
c2e12ed77d Add a note_with_comments factory 2016-10-10 15:08:11 +01:00
Andy Allan
5037e016cd Update browse_controller_test to use note and note_comment factories. 2016-10-06 09:03:31 +01:00
Tom Hughes
caa1a0128a Hide hidden notes and comments correctly in the data browser 2015-08-12 17:20:30 +01:00
Tom Hughes
35be112092 Yet more tests... 2015-03-08 19:55:45 +00:00
Tom Hughes
1891efef06 Testing, testing, testing... 2015-03-01 23:05:32 +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
98184dfb9c Reorganise tests to match modern rails test layout 2014-02-26 00:13:19 +00:00
Renamed from test/functional/browse_controller_test.rb (Browse further)