@@ -5,7 +5,7 @@ use fake::Fake;
5
5
use std:: time:: Duration ;
6
6
use uuid:: Uuid ;
7
7
use wiremock:: matchers:: { any, method, path} ;
8
- use wiremock:: { Mock , MockBuilder , ResponseTemplate } ;
8
+ use wiremock:: { Mock , ResponseTemplate } ;
9
9
10
10
async fn create_unconfirmed_subscriber ( app : & TestApp ) -> ConfirmationLinks {
11
11
let name = Name ( ) . fake :: < String > ( ) ;
@@ -46,10 +46,6 @@ async fn create_confirmed_subscriber(app: &TestApp) {
46
46
. unwrap ( ) ;
47
47
}
48
48
49
- fn when_sending_an_email ( ) -> MockBuilder {
50
- Mock :: given ( path ( "/email" ) ) . and ( method ( "POST" ) )
51
- }
52
-
53
49
#[ tokio:: test]
54
50
async fn you_must_be_logged_in_to_see_the_newsletter_form ( ) {
55
51
// Arrange
@@ -70,7 +66,7 @@ async fn you_must_be_logged_in_to_publish_a_newsletter() {
70
66
"title" : "Newsletter title" ,
71
67
"text_content" : "Newsletter content" ,
72
68
"html_content" : "<p>Newsletter content</p>" ,
73
- "idempotency_key" : uuid :: Uuid :: new_v4( ) . to_string( )
69
+ "idempotency_key" : Uuid :: new_v4( ) . to_string( )
74
70
}
75
71
) ;
76
72
@@ -97,7 +93,7 @@ async fn newsletters_are_not_delivered_to_unconfirmed_subscribers() {
97
93
"title" : "Newsletter title" ,
98
94
"text_content" : "Newsletter content" ,
99
95
"html_content" : "<p>Newsletter content</p>" ,
100
- "idempotency_key" : uuid :: Uuid :: new_v4( ) . to_string( )
96
+ "idempotency_key" : Uuid :: new_v4( ) . to_string( )
101
97
}
102
98
) ;
103
99
@@ -130,7 +126,7 @@ async fn newsletters_are_delivered_to_confirmed_subscribers() {
130
126
"title" : "Newsletter title" ,
131
127
"text_content" : "Newsletter body as plain text" ,
132
128
"html_content" : "<p>Newsletter body as HTML</p>" ,
133
- "idempotency_key" : uuid :: Uuid :: new_v4( ) . to_string( )
129
+ "idempotency_key" : Uuid :: new_v4( ) . to_string( )
134
130
} ) ;
135
131
136
132
let response = app. post_publish_newsletters ( & newsletter_request_body) . await ;
@@ -167,7 +163,7 @@ async fn newsletter_creation_is_idempotent() {
167
163
"html_content" : "<p>Newsletter body as HTML</p>" ,
168
164
// We expect the idempotency key as part of the
169
165
// form data, not as an header
170
- "idempotency_key" : uuid :: Uuid :: new_v4( ) . to_string( )
166
+ "idempotency_key" : Uuid :: new_v4( ) . to_string( )
171
167
} ) ;
172
168
173
169
let response = app. post_publish_newsletters ( & newsletter_request_body) . await ;
@@ -208,7 +204,7 @@ async fn concurrent_form_submission_is_handled_gracefully() {
208
204
"title" : "Newsletter title" ,
209
205
"text_content" : "Newsletter body as plain text" ,
210
206
"html_content" : "<p>Newsletter body as HTML</p>" ,
211
- "idempotency_key" : uuid :: Uuid :: new_v4( ) . to_string( )
207
+ "idempotency_key" : Uuid :: new_v4( ) . to_string( )
212
208
} ) ;
213
209
214
210
let response_1 = app. post_publish_newsletters ( & newsletter_request_body) ;
0 commit comments