Commit graph

810 commits

Author SHA1 Message Date
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
92fe7a8506 Only create diary entries for POST requests 2017-02-09 21:07:18 +00:00
Tom Hughes
349862f1b7 Test that GET on message#new can't send a message 2017-02-09 20:39:03 +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
Tom Hughes
0814b4096c Merge remote-tracking branch 'openstreetmap/pull/1347' into master 2017-02-05 16:02:20 +00:00
Andy Allan
8a6e8ae128 Convert client applications fixtures into a factory
Closes #1415
2017-01-26 18:03:51 +00:00
Tom Hughes
69b967c9ff Add support for Wikimedia authentication
Closes #1146
2016-12-20 22:32:25 +00:00
Tom Hughes
970e1a99d7 Merge remote-tracking branch 'openstreetmap/pull/1367' 2016-12-18 16:29:33 +00:00
Tom Hughes
34c473f503 Use only_path instead of setting an explicit host 2016-11-24 20:33:36 +00:00
Andy Allan
898c1475ba Add tags to features before propogating them. 2016-11-17 11:08:36 +00:00
Andy Allan
2f9ed9101a Fix spelling of propagate. 2016-11-17 10:49:52 +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
Tom Hughes
b8c80bae2d Stub nominatim for reverse lookups in note tests 2016-11-09 22:07:42 +00:00
Tom Hughes
a73ac770fb Stub nominatim for reverse lookups in diary tests 2016-11-09 21:54:26 +00:00
Tom Hughes
8eca904388 Rename stub_signup_requests to stub_hostip_requests 2016-11-09 20:36:09 +00:00
Tom Hughes
2f722fc281 Merge remote-tracking branch 'openstreetmap/pull/1350' 2016-11-09 20:32:54 +00:00
Andy Allan
f6ba15b1a3 Use 'def setup' instead of 'setup do', for consistency 2016-11-09 16:05:28 +00:00
Andy Allan
7cc1cc618d Extract the hostip.info stubbing into a common method.
There doesn't appear to be any before(:suite) equivalent for Minitest
so this is the least-surprising way to do this.
2016-11-09 16:00:47 +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
aa185bf4f8 Replace fixtures with factory for relation_tags 2016-10-31 12:30:57 +01:00
Andy Allan
97d63db369 Replace fixtures with factory for way_tags 2016-10-31 11:49:51 +01:00
Andy Allan
3026af170a Replace fixtures with factory for node_tags 2016-10-30 18:28:01 +01:00
Tom Hughes
fc0aebc1a8 Merge remote-tracking branch 'openstreetmap/pull/1352' 2016-10-30 16:59:20 +00:00
Andy Allan
e308da8daf Convert fixtures to factory for old_way_tags 2016-10-30 16:15:23 +01:00
Andy Allan
acb7f44069 Replace fixtures with a factory for old_node_tags
Also includes a slight simplification of the old_node_tags tests.
2016-10-30 15:36:33 +01:00
Andy Allan
596494a590 Replace changeset_tags fixtures with a factory. 2016-10-30 12:45:02 +01:00
Andy Allan
4eeea7e705 Remove the changesets_subscribers fixture.
Since there is no ChangesetsSubscribers model, we can't use a factory.
Instead we create the associations explicitly when needed.
2016-10-30 12:23:23 +01:00
Andy Allan
4d73706ff3 Refactor the gravatar email changes to use webmock stubbing
The main reason for doing this is to make the tests easier to read,
rather than having to look up both the gravatar fixture, and then
correlate that with the users fixture. Putting the expected response
code in the tests is much more explicit.
2016-10-30 11:06:35 +01:00
Andy Allan
90175c3bdb Stub out requests to gravatar.com during tests. 2016-10-30 10:28:58 +01:00
Andy Allan
d3d6e9902c Stub out requests to hostip.info during tests
These are detecting the correct locale for showing terms during signup
2016-10-30 10:28:46 +01: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
4a9aa0a12e Avoid double-escaping diary entry titles
The XML builder takes care of the escaping, and adding h() lead to
double-escaped titles in the RSS feed.
2016-10-29 17:17:56 +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
2df3605142 Merge remote-tracking branch 'openstreetmap/pull/1339' 2016-10-26 15:54:42 +01:00
Tom Hughes
8920a56133 Merge remote-tracking branch 'openstreetmap/pull/1338' 2016-10-26 15:48:56 +01:00
Andy Allan
c365e2b28a Convert the languages fixtures to a factory
For some tests, the existance of an 'en' language is assumed by
the database structure (not null default 'en'::character varying) so
this can be created in a setup block.
2016-10-26 13:14:52 +01:00
Andy Allan
a280f72bee Replace messages fixtures with a factory. 2016-10-26 11:41:18 +01:00
Andy Allan
72ae20ea3c Replace user_preferences fixture with a factory. 2016-10-26 10:07:49 +01:00
Andy Allan
2e9baaa50a Replace hardcoded user id with a reference to the relevant user fixture
This makes it easier to figure out what the 1 refers to.
2016-10-26 09:57:31 +01:00
Tom Hughes
e17b89e89f Fix rubocop warnings 2016-10-20 22:35:51 +01:00
Tom Hughes
4627b79885 Merge remote-tracking branch 'openstreetmap/pull/1331' 2016-10-19 11:52:17 +01: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
Andy Allan
23c3168c55 Replace user_blocks fixture with a factory.
Traits are used here to make the tests easier to read, and the
different traits can be combined where necessary.
2016-10-19 10:57:40 +01:00
Tom Hughes
e96f1e736a Merge remote-tracking branch 'openstreetmap/pull/1309' 2016-10-12 19:11:07 +01:00
Mikel Maron
be40536440 merge upstream/master and resolve conflicts from https://github.com/openstreetmap/openstreetmap-website/pull/1318 2016-10-12 10:52:05 -04: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
Mikel Maron
3726d561ea last minor fixes 2016-10-11 20:42:10 -04:00