Commit graph

13 commits

Author SHA1 Message Date
simon lehericey
7e8555923f feature(api): add ensure_token_is_not_expired to api_controller v1 and v2 2024-01-25 10:51:58 +01:00
simon lehericey
d8bc38bc69 feature(api): add ensure_authorized_network for api_controller v1 and v2 2024-01-25 10:51:58 +01:00
simon lehericey
118242dbd2 refactor api_controller 2023-09-20 14:11:09 +02:00
Paul Chavard
a47a056ee8 feat(api_token): api v1 use new token 2022-12-07 18:19:37 +01:00
Pierre de La Morinerie
4cb747fdb6 specs: always require rails_helper
Test helpers are separated between two files: spec_helper and
rails_helper. This separation is meant to allow tests that do not
require Rails (like testing standalone libs) to boot faster.

The spec_helper file is always loaded, through `--require spec_helper`
in the `.rspec` config file. When needed, the rails_helper file is
expected to be required manually.

This is fine, but:
- Many test files have a redundant `require 'spec_helper'` line;
- Many test files should require `rails_helper`, but don't.

Not requiring `rails_helper` will cause the Rails-concerned section of
the test environment not to be configured–which may cause subtle bugs
(like the test database not being properly initialized).

Moreover, Spring loads all the Rails files on preloading anyway. So the
gains from using only `spec_helper` are thin.

To streamline this process, this commit:
- Configures `.rspec` to require `rails_helper` by default;
- Remove all manual requires to spec_helper or rails_helper.

Reference: https://stackoverflow.com/questions/24145329/how-is-spec-rails-helper-rb-different-from-spec-spec-helper-rb-do-i-need-it
2020-03-31 12:48:32 +02:00
Paul Chavard
549eca44cb Enable flipflop on api requests 2019-03-12 14:02:55 +01:00
Paul Chavard
c37f649453 Update specs to use multiple administrateurs 2019-03-12 11:59:01 +01:00
simon lehericey
4a04f2e59f ApiController: check token validity for a given admin 2018-09-27 10:24:56 +02:00
simon lehericey
1997f45d7e Api Token: do not generate one token by default 2018-09-27 10:14:32 +02:00
gregoirenovel
b138dcd876 Enable the Layout/SpaceInsideHashLiteralBraces cop 2018-01-18 10:53:35 +01:00
gregoirenovel
d5e7bbd80d Files should end with a new line 2017-04-04 16:59:38 +02:00
Xavier J
430d32dfca Fix DEPRECATION WARNING for spec/controllers/*.rb 2016-11-15 04:24:09 +01:00
Tanguy PATTE
f474c8e8e1 add api v1 procedure controller 2015-12-21 17:51:49 +01:00