Andy Allan
df6469c76b
Convert class method tests to use User factory.
...
Also improve the tests by being explicit about which results should
be returned, rather than just hoping that the fixtures cover all
possibilities.
2017-02-02 13:05:43 +00:00
Andy Allan
0bd2e9ea8c
Add status traits to user factory.
2017-02-02 12:55:32 +00:00
Andy Allan
38fc6331af
Add moderator_user and administrator_user factories.
2017-02-02 12:38:19 +00:00
Andy Allan
c55169659c
Add a user_role factory
...
Naming the association in the model makes the relationship easier
to express in the factory.
2017-02-02 12:35:29 +00:00
Andy Allan
9e591d8ccb
Add with_home_location trait for user factories.
2017-02-02 12:08:36 +00:00
Andy Allan
589e9802a9
Create a simple user factory, and convert some basic tests.
2017-02-01 17:42:05 +00:00
Herve Saint-Amand
74e28f8bd0
Use each_with_object and make the code pithier
2017-01-28 23:27:04 +00:00
Andy Allan
8a6e8ae128
Convert client applications fixtures into a factory
...
Closes #1415
2017-01-26 18:03:51 +00:00
Tom Hughes
e1cac818b1
Merge remote-tracking branch 'openstreetmap/pull/1416'
2017-01-26 17:51:13 +00:00
Tom Hughes
ba092de0ac
Load user fixtures for ChangesetComment model tests
2017-01-26 17:50:11 +00:00
Andy Allan
7b0b09a527
Remove unused user_tokens fixture and pointless test.
2017-01-25 16:43:04 +00:00
Herve Saint-Amand
e59d6c567b
Rubocop finds 'return' statements redundant
2017-01-11 23:26:56 +00:00
Herve Saint-Amand
0449024ca0
Modify tests to search only text parts
...
The tests assumed that every part in the multipart emails that we send were either plain text or HTML. Now we have image attachments, against whose contents the tests were still trying to match regexes. The tests have been modified to only run regexes on the text parts of the mails.
2017-01-11 23:17:24 +00:00
Tom Hughes
69b967c9ff
Add support for Wikimedia authentication
...
Closes #1146
2016-12-20 22:32:25 +00:00
Tom Hughes
9badc45929
Load api fixtures in tag model tests
...
We still need them so we have the object to attach tags to.
2016-12-18 17:00:52 +00:00
Tom Hughes
0da97d2d3c
Get rid of hardwired counts in assertions
2016-12-18 16:43:58 +00:00
Tom Hughes
970e1a99d7
Merge remote-tracking branch 'openstreetmap/pull/1367'
2016-12-18 16:29:33 +00:00
Tom Hughes
b9b255fa65
Work around upcoming minitest insanity
...
Minitest 6 will not allow assert_equal to compare for equality
with nil and minitest 5 has already started warning about it.
That's fine if you're comparing with a nil constant, but if you're
comparing with an expression that is sometimes nil and sometimes
not nil it's an absolute pain in the rear end.
2016-12-02 22:29:44 +00:00
Tom Hughes
c8f26592a7
Fix rubocop warnings
2016-12-02 22:01:40 +00:00
Tom Hughes
44e778aedd
Increase password stretching to 10000 interations
...
This is in line with current reccomendations from various sources.
2016-11-25 08:54:57 +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
5c9f1310b0
Convert more 'setup do' to 'def setup' for consistency
2016-11-09 20:33:55 +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
Tom Hughes
e84f0c710d
Reject oauth nonces over a day old
2016-11-03 07:14:19 +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
aba28ec9e0
Replace fixtures with a factory for old_relation_tags
2016-10-30 16:32:11 +01: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
5e86393f72
Use webmock to power the with_http_stubs helper
...
This involves a small amount of changing the fixtures since we're
using the regexp and not the full url matching powers of webmock.
2016-10-30 10:29:16 +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
6bc488a983
Add webmock to intercept real http connections during tests
...
Intercepting real http connections also allows running the test
suite without an internet connection.
2016-10-30 10:28:26 +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