Skip to content

Commit f5b8805

Browse files
committed
move more tests to the new expected/actual format
1 parent ecaf6ce commit f5b8805

File tree

128 files changed

+193
-270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+193
-270
lines changed

tests/core/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ async fn test_routing_with_prefix() {
8888

8989
let app_data = actix_web::web::Data::new(state);
9090
let resp = req_path_with_app_data(
91-
"/prefix/tests/sql_test_files/it_works_simple.sql",
91+
"/prefix/tests/sql_test_files/component_rendering/it_works_simple.sql",
9292
app_data.clone(),
9393
)
9494
.await
@@ -121,9 +121,12 @@ async fn test_routing_with_prefix() {
121121
.to_string();
122122
assert!(resp.to_lowercase().contains("forbidden"), "{resp}");
123123

124-
let resp = req_path_with_app_data("/tests/sql_test_files/it_works_simple.sql", app_data)
125-
.await
126-
.unwrap();
124+
let resp = req_path_with_app_data(
125+
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
126+
app_data,
127+
)
128+
.await
129+
.unwrap();
127130
assert_eq!(resp.status(), StatusCode::MOVED_PERMANENTLY);
128131
let location = resp
129132
.headers()

tests/core/select_temp_t.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
-- see tests/sql_test_files/it_works_temp_table_accessible_in_run_sql.sql
1+
-- see tests/sql_test_files/component_rendering/it_works_temp_table_accessible_in_run_sql_nomssql.sql
22
select 'text' as component, x as contents from temp_t;

tests/data_formats/mod.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ async fn test_json_columns() {
9696
#[actix_web::test]
9797
async fn test_accept_json_returns_json_array() -> actix_web::Result<()> {
9898
let resp = req_with_accept(
99-
"/tests/sql_test_files/it_works_simple.sql",
99+
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
100100
"application/json",
101101
)
102102
.await?;
@@ -117,7 +117,7 @@ async fn test_accept_json_returns_json_array() -> actix_web::Result<()> {
117117
#[actix_web::test]
118118
async fn test_accept_ndjson_returns_jsonlines() -> actix_web::Result<()> {
119119
let resp = req_with_accept(
120-
"/tests/sql_test_files/it_works_simple.sql",
120+
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
121121
"application/x-ndjson",
122122
)
123123
.await?;
@@ -143,7 +143,11 @@ async fn test_accept_ndjson_returns_jsonlines() -> actix_web::Result<()> {
143143

144144
#[actix_web::test]
145145
async fn test_accept_html_returns_html() -> actix_web::Result<()> {
146-
let resp = req_with_accept("/tests/sql_test_files/it_works_simple.sql", "text/html").await?;
146+
let resp = req_with_accept(
147+
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
148+
"text/html",
149+
)
150+
.await?;
147151
assert_eq!(resp.status(), StatusCode::OK);
148152
assert_eq!(
149153
resp.headers().get(header::CONTENT_TYPE).unwrap(),
@@ -156,7 +160,11 @@ async fn test_accept_html_returns_html() -> actix_web::Result<()> {
156160

157161
#[actix_web::test]
158162
async fn test_accept_wildcard_returns_html() -> actix_web::Result<()> {
159-
let resp = req_with_accept("/tests/sql_test_files/it_works_simple.sql", "*/*").await?;
163+
let resp = req_with_accept(
164+
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
165+
"*/*",
166+
)
167+
.await?;
160168
assert_eq!(resp.status(), StatusCode::OK);
161169
assert_eq!(
162170
resp.headers().get(header::CONTENT_TYPE).unwrap(),

tests/server_timing/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async fn test_server_timing_disabled_in_production() -> actix_web::Result<()> {
1010
let app_data = make_app_data_from_config(config).await;
1111

1212
let req = crate::common::get_request_to_with_data(
13-
"/tests/sql_test_files/it_works_simple.sql",
13+
"/tests/sql_test_files/component_rendering/it_works_simple.sql",
1414
app_data,
1515
)
1616
.await?
@@ -32,7 +32,7 @@ async fn test_server_timing_enabled_in_development() -> actix_web::Result<()> {
3232
let app_data = make_app_data_from_config(config).await;
3333

3434
let req = crate::common::get_request_to_with_data(
35-
"/tests/sql_test_files/it_works_postgres_cast_syntax.sql",
35+
"/tests/sql_test_files/data/it_works_postgres_cast_syntax.sql",
3636
app_data,
3737
)
3838
.await?
@@ -72,7 +72,7 @@ async fn test_server_timing_enabled_in_development() -> actix_web::Result<()> {
7272

7373
#[actix_web::test]
7474
async fn test_server_timing_format() -> actix_web::Result<()> {
75-
let req = get_request_to("/tests/sql_test_files/it_works_postgres_cast_syntax.sql")
75+
let req = get_request_to("/tests/sql_test_files/data/it_works_postgres_cast_syntax.sql")
7676
.await?
7777
.to_srv_request();
7878
let resp = main_handler(req).await?;

tests/sql_test_files/README.md

Lines changed: 14 additions & 12 deletions

0 commit comments

Comments
 (0)