Andy Allan
b446138aef
Rename trace_controller to traces_controller
2018-05-09 12:38:09 +08:00
biswesh456
674589ce2c
Change test case
2018-03-03 20:20:52 +05:30
biswesh456
646dcb62fc
Allow admins and moderators to delete traces
...
Fixes #1625
2018-02-24 20:36:12 +05:30
Tom Hughes
2ef803b9df
Update rack-test and patch test issues
2017-11-29 20:35:17 +00:00
Tom Hughes
f02c753cc4
Use send_data for GPX traces intead of monkey patching send_file
2017-10-09 20:38:08 +01:00
Andy Allan
c647aa3d4d
Refactor the from_xml methods to act on existing trace objects.
...
Setting the new tags with the = operator takes care of removing the
old ones, and is the same approach as taken by the tagstring= method.
Fixes #1600
2017-08-18 10:09:50 +01:00
Andy Allan
e9324ad681
Add failing test demonstrating tag duplication when updating traces via the API.
2017-08-17 19:03:50 +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
03408b6294
Update get/post etc to remove use of deprecated syntax
2017-06-27 08:26:44 +01:00
Tom Hughes
5b33f3f8e3
Fix rubocop warnings
2017-06-02 00:08:30 +01:00
Tom Hughes
3a16b68368
Use POST when editing GPX trace details
...
Fixes #1533
2017-05-01 16:56:02 +01:00
Tom Hughes
da57077c0b
Improve trace#api_data tests
...
The api_data action doesn't actually take the username as an
arguement and should be modelled on api_read rather than the
actions that handle web views.
2017-03-09 18:28:46 +00:00
Andy Allan
56e979c353
Remove redundant tests for deleted traces, and rearrange comments and factory calls for consistency.
2017-03-09 17:21:46 +00:00
Andy Allan
18c25b620b
Create a fresh user when requesting non-existent traces.
2017-03-09 14:50:02 +00:00
Andy Allan
2b06961ce3
Use user factory for trace_controller tests
2017-03-09 10:13:18 +00:00
Andy Allan
7d9d496da2
Pass the user object, rather than the id, for sessions.
...
This simplifies the code slightly.
2017-02-22 09:57:18 +00:00
Tom Hughes
e23541c20f
Allow a POST with no arguments to trace#edit to fetch the form
2017-02-13 10:09:43 +00:00
Tom Hughes
f435fce007
Link GPX fixture files instead of stubbing
2017-02-05 17:26:31 +00:00
Tom Hughes
71c2fc671f
Cleanup double comment markers
2017-02-05 17:25:54 +00:00
Andy Allan
62346c7e88
Be explicit in which traces are expected.
...
I think this is an improvement compared to running db queries to
fetch the expected results.
2016-11-17 10:26:54 +00:00
Andy Allan
717f4e1b7b
Create object for list tests, and assert the responses have the
...
required number of results.
Previously, the tests would pass regardless of whether anything was
in the database.
2016-11-16 20:08:16 +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
d80dee4989
Move instance creation to the top of the test methods.
2016-11-01 10:43:38 +00:00
Andy Allan
a32333ba12
Use stub_any_instance in order to stub find results.
...
This is a much cleaner approach than before.
2016-10-30 10:22:10 +01: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
Andy Allan
72ae20ea3c
Replace user_preferences fixture with a factory.
2016-10-26 10:07:49 +01:00
Tom Hughes
f94340b9e8
Fix tests that made assumptions about tag ordering
2016-03-09 13:47:05 +00:00
Tom Hughes
1891efef06
Testing, testing, testing...
2015-03-01 23:05:32 +00:00
Tom Hughes
e07d225568
Fix rubocop warnings
2015-03-01 17:23:17 +00:00
Tom Hughes
fd588cd715
The test train rolls ever onwards...
2015-03-01 17:04:39 +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
1a38e9b315
Don't pass strings to set_fixture_class
2014-04-27 19:16:42 +01:00
Tom Hughes
98184dfb9c
Reorganise tests to match modern rails test layout
2014-02-26 00:13:19 +00:00