Commit graph

29 commits

Author SHA1 Message Date
Andy Allan
1f242978af Prefer keyword arguments when method has optional boolean arguments 2020-11-12 11:24:44 +00:00
Tom Hughes
ea59d95f4a Fix some new rubocop warnings 2020-08-06 22:27:30 +01:00
Tom Hughes
7a1615bc55 Fix rubocop-minitest warnings 2020-04-15 19:07:13 +01: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
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
Tom Hughes
57f5b7840e Fix rubocop warnings 2019-12-04 19:31:53 +00:00
Tom Hughes
18f5f1d499 Explicitly require gpx in the trace model tests
If we don't do this and no other test manages to trigger an
autoload before we run then we might try and autoload it inside
a MockFS block which will fail.
2019-08-14 19:10:15 +01:00
Tom Hughes
26cbdcf71a Fix importing of GPX traces with a leading byte order marker
Fixes #2258
2019-06-14 19:01:53 +01:00
Tom Hughes
b5d903c603 Test import of various trace formats
Fixes #2254
2019-06-11 19:52:51 +01:00
Andy Allan
400db58036 Use activerecord-import for bulk importing tracepoint records
Non-rigourous testing shows a significant speedup, even on ssds.
2019-03-20 10:35:40 +01:00
Andy Allan
d102c9aaf4 Move all settings to settings.yml
We leave the STATUS setting alone, since it's required before rails
boots. The test-specific settings now live in config/settings/test.yml
2019-03-13 18:06:23 +01:00
Tom Hughes
f7694a94c1 Update tests for changes in FactoryBot 5.x 2019-02-07 20:21:40 +00:00
Andy Allan
65e8bbd5f8 Remove unnecessary requires from tests 2019-02-06 11:44:34 +01:00
Andy Allan
d02e4ad461 Write some basic functionality tests for trace.import 2019-01-23 16:47:54 +01:00
Andy Allan
2267f44954 Use user factory for trace model tests. 2017-03-09 10:53:11 +00:00
Tom Hughes
f435fce007 Link GPX fixture files instead of stubbing 2017-02-05 17:26:31 +00:00
Andy Allan
a66f0f32e9 Rename test trace fixtures to use letters instead of numbers.
This prevents them from being deleted by mistake, if trace.delete is
called on a factory-generated trace with a coincidental id.
2016-11-16 17:45:26 +00:00
Andy Allan
ea502ac9df Rubocop fix. 2016-10-29 17:32:50 +02:00
Andy Allan
15689af6bf Replace trace-related fixtures with factories.
The mocking and stubbing in the controller tests is
unfortunate, but the models interact directly with the filesystem
using the trace id so that's hard to control any other way.
2016-10-29 16:23:04 +02:00
Tom Hughes
8fe1899596 Fix rubocop warnings 2016-01-19 09:51:24 +00:00
Tom Hughes
21d60e359a Tests! 2015-03-04 21:49:43 +00:00
Tom Hughes
fd588cd715 The test train rolls ever onwards... 2015-03-01 17:04:39 +00:00
Tom Hughes
857f0f460b More work on test coverage 2015-02-28 00:45:56 +00:00
Tom Hughes
cd3db7df4d Fix validation failures for trace tags
Fixes #914
2015-02-27 10:04:40 +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
28bfb9999f Rename Trace#public to Trace#visible_to_all 2014-07-04 19:24:25 +01:00
Tom Hughes
98184dfb9c Reorganise tests to match modern rails test layout 2014-02-26 00:13:19 +00:00
Renamed from test/unit/trace_test.rb (Browse further)