Commit graph

1199 commits

Author SHA1 Message Date
Tom Hughes
bbd24879fd Merge remote-tracking branch 'openstreetmap/pull/1458' 2017-02-22 17:55:37 +00:00
Tom Hughes
df24950854 Merge remote-tracking branch 'openstreetmap/pull/1457' 2017-02-22 12:28:13 +00:00
Andy Allan
f4835594b6 Convert notes_controller tests to user factories. 2017-02-22 11:33:50 +00:00
Andy Allan
c84a371d97 Revert changes where the user is a query parameter 2017-02-22 11:07:43 +00:00
Andy Allan
8bd98b5da8 Refactor api_controller tests to avoid users fixtures. 2017-02-22 11:03:39 +00:00
Andy Allan
38a3e4ba2b Refactor amf_controller tests to avoid users fixtures
In all honesty I wouldn't be surprised if there are some semi-hidden
dependencies on the user fixtures here, given the number of magic numbers
all over the place. But this commit takes care of the explicit
dependencies for now.
2017-02-22 10:30:53 +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
1dc2ff7d57 Merge remote-tracking branch 'openstreetmap/pull/1449' 2017-02-21 17:05:39 +00:00
Andy Allan
737a325f2e Refactor diary entry tests to use User factory 2017-02-19 16:43:32 +00:00
Tom Hughes
9b52542e52 Use simple string matches for user_blocks_helper tests
Testing against the translations is not something we do anywhere
else is and is dangerously close to testing the helper against
itself which is a bit pointless.
2017-02-19 11:50:01 +00:00
Tom Hughes
9c926c6c71 Use the factory to create user blocks 2017-02-19 11:42:38 +00:00
Simon Poole
325cd12c24 Make rupocop happy and correct placement of include 2017-02-19 12:35:02 +01:00
Simon Poole
455e906afa Improve wording and add test 2017-02-19 11:59:34 +01: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
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
Tom Hughes
c7dc3ee722 Use .first in place of [0] 2017-02-05 13:57:25 +00:00
Tom Hughes
c57d2b29fc Merge remote-tracking branch 'openstreetmap/pull/1401' 2017-02-05 13:50:07 +00:00
Tom Hughes
7793cd27ab Merge remote-tracking branch 'openstreetmap/pull/1423' 2017-02-02 17:21:41 +00:00
Andy Allan
1041ead253 Convert the test_users_nearby to user factories. 2017-02-02 13:52:26 +00:00
Andy Allan
3b26ff0c40 Use factory for user language tests 2017-02-02 13:33:15 +00:00
Andy Allan
b83271de92 Refactor the friend_users test, and remove the tests which duplicate the (renamed) test_friends_with above. 2017-02-02 13:24:46 +00:00
Andy Allan
f96c563c10 Convert test_friend_with to use factories, and use alice/bob/charlie for easier understanding. 2017-02-02 13:20:51 +00:00
Andy Allan
584748fe0a User factory for uniqueness tests 2017-02-02 13:09:39 +00:00
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