Commit graph

82 commits

Author SHA1 Message Date
Andy Allan
b54362d458 Use deliver_later for all email sending 2018-10-31 16:38:12 +01:00
Tom Hughes
5ff822083d Block non-localhost requests for all tests
Only blocking them for the system tests didn't actually
work anyway as the setting is global so would apply to all
tests after the first system test.
2018-07-10 18:59:15 +01:00
Tom Hughes
d66b4b3d2f Fix stubbing of hostip requests 2018-07-09 20:15:42 +01:00
Tom Hughes
98de681e47 Update to rails 5.2.0 2018-06-19 00:16:24 +01:00
Andy Allan
0a86a1ea8d Fix handling of title when replying to diary entries 2018-04-11 14:03:17 +08:00
Tom Hughes
1f2ac59d1d Fix new rubocop warnings 2018-03-26 19:00:03 +01:00
Tom Hughes
a83030dab7 Fix new rubocop warnings 2018-01-22 18:55:45 +00:00
Tom Hughes
b2fa947502 Replace factory_girl with factory_bot 2017-10-29 19:29:30 +00:00
Andy Allan
c12459dead Remove test fixtures. 2017-06-01 11:01:17 +01:00
Andy Allan
5d0ea28796 Remove the api_fixtures helper
This is no longer required, as the tests no longer use fixtures.
2017-06-01 10:59:48 +01:00
Tom Hughes
0814b4096c Merge remote-tracking branch 'openstreetmap/pull/1347' into master 2017-02-05 16:02:20 +00:00
Tom Hughes
c57d2b29fc Merge remote-tracking branch 'openstreetmap/pull/1401' 2017-02-05 13:50:07 +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
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
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
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
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
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
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
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
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
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
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
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
Andy Allan
41c9bc2326 Remove the note and note_comments fixtures
You may need to run "DELETE FROM notes" and "DELETE FROM note_comments"
on your local test database.
2016-10-06 09:17:58 +01:00
Andy Allan
d5013ad0d2 Add FactoryGirl 2016-09-07 15:28:28 +01:00
Simon Poole
8283a39dbc Support returning a HTTP status code for the http stubs for testing 2016-08-16 21:42:02 +02:00
Tom Hughes
cd973c241f Load changeset comments for API tests 2015-03-09 00:08:12 +00:00
Tom Hughes
1891efef06 Testing, testing, testing... 2015-03-01 23:05:32 +00:00
Tom Hughes
8cf82ea658 Load user_blocks as an API fixture 2015-02-28 01:00:30 +00:00
Tom Hughes
f8f921e09d Add Coveralls support 2015-02-26 19:20:17 +00:00
Tom Hughes
eaf4b32a7f Rework OpenID tests for new flows using OmniAuth mocking 2015-02-25 01:07:23 +00:00
Tom Hughes
a6b84a0294 Fix more rubocop style issues 2015-02-24 23:12:02 +00:00
Tom Hughes
dc2a2c8ebd Standardise on double quoted strings 2015-02-20 19:47:26 +00:00
Tom Hughes
5cbd4038ed Fix rubocop style issues 2015-02-20 08:56:16 +00:00
Tom Hughes
baf10cd392 Fix rubocop lint issues 2015-02-20 08:56:16 +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
1a38e9b315 Don't pass strings to set_fixture_class 2014-04-27 19:16:42 +01:00
Tom Hughes
7de32f3cd5 Add a basic test for browse#note 2013-10-01 19:34:36 +01:00