Store password reset requests in database
#610
feature/persist_password_reset
into master
5 years ago
@ -0,0 +1 @@
|
||||
DROP TABLE password_reset_requests;
|
@ -0,0 +1,9 @@
|
||||
CREATE TABLE password_reset_requests (
|
||||
id SERIAL PRIMARY KEY,
|
||||
email VARCHAR NOT NULL,
|
||||
token VARCHAR NOT NULL,
|
||||
expiration_date TIMESTAMP NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX password_reset_requests_token ON password_reset_requests (token);
|
||||
CREATE UNIQUE INDEX password_reset_requests_email ON password_reset_requests (email);
|
@ -0,0 +1 @@
|
||||
DROP TABLE password_reset_requests;
|
@ -0,0 +1,9 @@
|
||||
CREATE TABLE password_reset_requests (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
email VARCHAR NOT NULL,
|
||||
token VARCHAR NOT NULL,
|
||||
expiration_date DATETIME NOT NULL
|
||||
);
|
||||
|
||||
CREATE INDEX password_reset_requests_token ON password_reset_requests (token);
|
||||
CREATE UNIQUE INDEX password_reset_requests_email ON password_reset_requests (email);
|
@ -0,0 +1,164 @@
|
||||
|
||||
use chrono::{offset::Utc, Duration, NaiveDateTime};
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
use diesel::{ExpressionMethods, QueryDsl, RunQueryDsl};
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
use schema::password_reset_requests;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
use {Connection, Error, Result};
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
#[derive(Clone, Identifiable, Queryable)]
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub struct PasswordResetRequest {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub id: i32,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub email: String,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub token: String,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub expiration_date: NaiveDateTime,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
#[derive(Insertable)]
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
#[table_name = "password_reset_requests"]
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub struct NewPasswordResetRequest {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub email: String,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub token: String,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub expiration_date: NaiveDateTime,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
const TOKEN_VALIDITY_HOURS: i64 = 2;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
impl PasswordResetRequest {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub fn insert(conn: &Connection, email: &str) -> Result<String> {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
// first, delete other password reset tokens associated with this email:
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let existing_requests =
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
password_reset_requests::table.filter(password_reset_requests::email.eq(email));
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
diesel::delete(existing_requests).execute(conn)?;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
// now, generate a random token, set the expiry date,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
// and insert it into the DB:
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let token = plume_common::utils::random_hex();
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let expiration_date = Utc::now()
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.naive_utc()
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.checked_add_signed(Duration::hours(TOKEN_VALIDITY_HOURS))
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.expect("could not calculate expiration date");
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let new_request = NewPasswordResetRequest {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
email: email.to_owned(),
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
token: token.clone(),
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
expiration_date,
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
};
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
diesel::insert_into(password_reset_requests::table)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.values(new_request)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.execute(conn)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.map_err(Error::from)?;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
Ok(token)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub fn find_by_token(conn: &Connection, token: &str) -> Result<Self> {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let token = password_reset_requests::table
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.filter(password_reset_requests::token.eq(token))
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.first::<Self>(conn)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.map_err(Error::from)?;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
if token.expiration_date < Utc::now().naive_utc() {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
return Err(Error::Expired);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
Ok(token)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
pub fn find_and_delete_by_token(conn: &Connection, token: &str) -> Result<Self> {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let request = Self::find_by_token(&conn, &token)?;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let filter =
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
password_reset_requests::table.filter(password_reset_requests::id.eq(request.id));
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
diesel::delete(filter).execute(conn)?;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
Ok(request)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
#[cfg(test)]
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
mod tests {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
use super::*;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
use diesel::Connection;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
use tests::db;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
use users::tests as user_tests;
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
#[test]
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
fn test_insert_and_find_password_reset_request() {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let conn = db();
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
conn.test_transaction::<_, (), _>(|| {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
user_tests::fill_database(&conn);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let admin_email = "admin@example.com";
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let token = PasswordResetRequest::insert(&conn, admin_email)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.expect("couldn't insert new request");
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let request = PasswordResetRequest::find_by_token(&conn, &token)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.expect("couldn't retrieve request");
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
assert!(&token.len() > &32);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
assert_eq!(&request.email, &admin_email);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
Ok(())
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
});
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
#[test]
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
fn test_insert_delete_previous_password_reset_request() {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let conn = db();
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
conn.test_transaction::<_, (), _>(|| {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
user_tests::fill_database(&conn);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let admin_email = "admin@example.com";
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
PasswordResetRequest::insert(&conn, &admin_email).expect("couldn't insert new request");
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
PasswordResetRequest::insert(&conn, &admin_email)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.expect("couldn't insert second request");
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let count = password_reset_requests::table.count().get_result(&*conn);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
assert_eq!(Ok(1), count);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
Ok(())
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
});
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
#[test]
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
fn test_find_password_reset_request_by_token_time() {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let conn = db();
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
conn.test_transaction::<_, (), _>(|| {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
user_tests::fill_database(&conn);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let admin_email = "admin@example.com";
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let token = "abcdef";
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let now = Utc::now().naive_utc();
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
diesel::insert_into(password_reset_requests::table)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.values((
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
password_reset_requests::email.eq(&admin_email),
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
password_reset_requests::token.eq(&token),
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
password_reset_requests::expiration_date.eq(now),
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
))
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.execute(&*conn)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.expect("could not insert request");
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
match PasswordResetRequest::find_by_token(&conn, &token) {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
Err(Error::Expired) => (),
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
_ => panic!("Received unexpected result finding expired token"),
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
Ok(())
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
});
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
#[test]
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
fn test_find_and_delete_password_reset_request() {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let conn = db();
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
conn.test_transaction::<_, (), _>(|| {
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
user_tests::fill_database(&conn);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let admin_email = "admin@example.com";
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let token = PasswordResetRequest::insert(&conn, &admin_email)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.expect("couldn't insert new request");
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
PasswordResetRequest::find_and_delete_by_token(&conn, &token)
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
.expect("couldn't find and delete request");
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
let count = password_reset_requests::table.count().get_result(&*conn);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
assert_eq!(Ok(0), count);
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
Ok(())
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
});
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
||||
}
|
||||
Review
It would be good to test that old password reset requests are ignored. The simplest way I can think of would be to insert a record, and then update its It would be good to test that old password reset requests are [ignored](https://github.com/Plume-org/Plume/pull/610/files#diff-a248869f1983a92462c39c8b2ea8a66eR44).
The simplest way I can think of would be to insert a record, and then update its `creation_date` with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.
Review
More seriously, I think you can pass tuples to
You can probably use it instead of ~~`thread::sleep(2 * 60 * 60 * 1000)`~~
More seriously, I think you can pass tuples to `diesel::insert_into(...).values()`, like:
```rust
diesel::insert_into(password_reset_requests::table)
.values((
password_reset_requests::email.eq("foo@bar.org"),
password_reset_requests::token.eq("aaaaaaaaa"),
password_reset_requests::creation_date.eq(now - 3.hours()),
))
```
You can probably use it instead of `PasswordResetRequest::insert` in this test.
|
@ -0,0 +1,9 @@
|
||||
@use template_utils::*;
|
||||
@use templates::base;
|
||||
|
||||
@(ctx: BaseContext)
|
||||
|
||||
@:base(ctx, i18n!(ctx.1, "Password reset"), {}, {}, {
|
||||
<h1>@i18n!(ctx.1, "This token has expired")</h1>
|
||||
<p>@i18n!(ctx.1, "Please start the process again by clicking") <a href="/password-reset">@i18n!(ctx.1, "here")</a>.</p>
|
||||
})
|
It would be good to test that old password reset requests are ignored.
The simplest way I can think of would be to insert a record, and then update its
creation_date
with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.It would be good to test that old password reset requests are ignored.
The simplest way I can think of would be to insert a record, and then update its
creation_date
with some raw SQL in the test. It feels pretty dirty though. Better ideas appreciated.thread::sleep(2 * 60 * 60 * 1000)
More seriously, I think you can pass tuples to
diesel::insert_into(...).values()
, like:You can probably use it instead of
PasswordResetRequest::insert
in this test.thread::sleep(2 * 60 * 60 * 1000)
More seriously, I think you can pass tuples to
diesel::insert_into(...).values()
, like:You can probably use it instead of
PasswordResetRequest::insert
in this test.