Commit graph

190 commits

Author SHA1 Message Date
Andy Allan
da2277505f Ensure that test utility methods are marked as private
This allows us to enable the check for test method names.
2020-10-28 11:49:01 +01:00
Andy Allan
86a5e198f7 Refactor test to use general basic_authorization_header method
There's no need for this test to have its own version of the method.
2020-10-28 11:33:51 +01:00
Tom Hughes
abca51e4d8 Fix some Style/StringConcatenation warnings 2020-08-09 19:48:16 +01:00
Tom Hughes
75e135869e Fix Style/ExplicitBlockArgument warnings 2020-08-09 19:06:04 +01:00
Tom Hughes
2d3972249c Fix some rubocop todos 2020-08-02 19:38:58 +01:00
Tom Hughes
bf22c69286 Improve locale selection algorithm
Don't include locales which only have rails translations in
the candidates, and ensure that user specified options take
priority over less specific variants of earlier choices.
2020-06-04 17:33:11 +01:00
Tom Hughes
6f342c7616 Switch oauth integration tests to use new shared helper 2020-05-05 18:04:48 +01:00
Andy Allan
f885cfe0f5 Rename form-row to standard-form-row to avoid clashing with a bootstrap class 2020-01-15 17:16:11 +01:00
Tom Hughes
473da378b7 Remove fallback to hostip.info
We haven't used hostip.info in production for years, except
for when we did so by accident, leading to a two hour partial
outage when it went down.
2020-01-06 19:14:12 +00:00
Andy Allan
c4c1f8ded3 Reformat params hashes to avoid super-long lines 2019-12-18 15:58:37 +01:00
Andy Allan
7595e5a4dd Use squiggly heredocs instead of rails strip_heredoc
Squiggly heredocs were introduced in ruby 2.3 and I prefer the ability
to indent the closing heredoc marker.
2019-12-11 10:54:19 +01:00
Tom Hughes
1f4d48eaf3 Fix some deprecation warnings 2019-11-24 11:05:02 +00:00
Andy Allan
b7893df84e Refactor diary entries to use create and update methods
This brings it slightly more into line with resourceful routing.
2019-05-29 15:37:23 +02:00
Simon Poole
b89e6c2274 Update user_creation_test for new parameter 2019-05-13 16:54:29 +02:00
Simon Poole
e30813bbb1 Rubocop fixes and increase per method complexity limit from 23 to 25 2019-05-13 16:54:29 +02:00
Simon Poole
51c84869c4 Fix tests for change in users_controller, add test for missing read_tou 2019-05-13 16:54:29 +02:00
Tom Hughes
9e759dc030 Expect CORS preflight responses to not have a content type
https://github.com/cyu/rack-cors/pull/180
2019-03-28 08:45:58 +00:00
Andy Allan
d102c9aaf4 Move all settings to settings.yml
We leave the STATUS setting alone, since it's required before rails
boots. The test-specific settings now live in config/settings/test.yml
2019-03-13 18:06:23 +01:00
Tom Hughes
d2ff1491b4 Avoid CSP issues with OpenID login
To avoid Chrom getting upset about sending form data to sites
that our policy doesn't allow, even when it isn't, use Javascript
to jump straight to Omniauth as the direct OpenID based login
buttons were already doing.

Fixes #1909
2019-02-25 11:46:12 +00:00
Andy Allan
35a2d66e19 Remove require_terms_agreed configuration option
This has been set to true for 6 years in production. Refs #2097

As per other user settings, we set the terms as seen by default for tests,
and we can override that when necessary for specific tests.
2019-02-06 15:50:57 +01:00
Andy Allan
3795da4014 Remove the require_terms_seen configuration option
This option has been set to 'true' for over six years in production.

Refs #2097
2019-02-06 14:54:56 +01:00
Andy Allan
ed8e15c8f0 Remove user_roles integration test since it is not meaningful
This test has not been meaningful for a long while, since both check_success and check_fail contain exactly the same code.

Additionally, the test doesn't cover any integrations (beyond logging in), and so it is only covering the same ground as the controller test.
2018-11-28 17:22:31 +01:00
Andy Allan
252b9ef08a Pluralize changesets controller 2018-11-14 10:34:28 +01:00
Andy Allan
26777c4464 Pluralize diary entries controller 2018-11-07 16:31:04 +01:00
Andy Allan
b54362d458 Use deliver_later for all email sending 2018-10-31 16:38:12 +01:00
Andy Allan
3ec67ea2d3 Rename user_controller to users_controller 2018-10-03 15:31:10 +02:00
Wil
a182820139 Resolve 96 Rubocop Lint/AmbiguousRegexpLiteral conflicts 2018-09-10 11:28:16 +08:00
Andy Allan
19c26e70a3 Rename user#view to user#show 2018-09-05 14:21:01 +08:00
Tom Hughes
cb3c4ec09b Update for rubocop 0.54.0 2018-05-17 19:39:25 +01:00
Andy Allan
e1c62f1bf2 Remove if_user and similar methods
Rather than hiding features based on CSS, just avoid including them
in the output. Fixes #1862
2018-05-16 13:05:20 +08:00
Tom Hughes
b590fdccfc Fix rubocop warnings 2018-01-24 14:37:37 +00:00
Tom Hughes
4e9144fba2 Add support for compressed request bodies 2018-01-24 14:25:02 +00:00
Tom Hughes
a83030dab7 Fix new rubocop warnings 2018-01-22 18:55:45 +00:00
Tom Hughes
8dae890a76 Fix rubocop warnings 2017-10-05 19:18:38 +01:00
Tom Hughes
8c513beec6 Update rack-cors and fix tests for changes in behaviour 2017-07-31 21:55:01 +01:00
Tom Hughes
4874219ab8 Mark account suspended flash message as HTML safe
Fixes #1590
2017-07-19 00:31:03 +01:00
Tom Hughes
3893fd72a9 Fix some tests for changes in rails 5 2017-06-27 08:26:44 +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
07673278f1 Remove deprecated get_via_direct and post_via_redirect methods 2017-06-06 00:03:39 +01:00
Tom Hughes
5b33f3f8e3 Fix rubocop warnings 2017-06-02 00:08:30 +01:00
Tom Hughes
95eda2d381 Update bundle 2017-06-02 00:08:30 +01:00
Andy Allan
4922771aff Use the user factory to generate login details. 2017-05-31 18:15:24 +01:00
Andy Allan
ae83554929 Use a user factory in order to log in. 2017-05-31 16:52:08 +01:00
Andy Allan
1911ea8914 Refactor user_changeset_comments integration test to use factories. 2017-05-31 10:45:14 +01:00
Andy Allan
5370f9c6a7 Refactor the oauth integration test to avoid using user fixtures. 2017-03-15 16:13:04 +00:00
Andy Allan
a6a1a6baa5 Use user factory for user_terms_seen integration test. 2017-03-15 15:53:47 +00:00
Tom Hughes
ae4c00da8c Merge remote-tracking branch 'openstreetmap/pull/1484' 2017-03-10 15:58:57 +00:00
Andy Allan
113506bf51 Use user factories for user_login integration tests.
The display_name logins were reworked to use downcase since the
factories supply users with an already-title-cased display_name.

The tests were also renamed to align better with the purpose of the
test rather than the name of the fixture used.
2017-03-10 14:53:36 +00:00
Andy Allan
b690feba15 Use user factories for page_locale integration tests. 2017-03-10 14:53:19 +00:00
Andy Allan
dfbb952707 Use user factories for user_block integration tests. 2017-03-10 14:48:29 +00:00