Skip to content

Commit

Permalink
Merge pull request #18 from peridio/ENG-1624
Browse files Browse the repository at this point in the history
disabled releases
  • Loading branch information
andresperi authored May 7, 2024
2 parents a3c3099 + 244b50d commit 1e03a5b
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/api/devices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub struct Device {
pub healthy: Option<bool>,
pub identifier: String,
pub last_communication: String,
pub prn: String,
pub status: String,
pub tags: Option<Vec<String>>,
pub version: String,
Expand Down
5 changes: 5 additions & 0 deletions src/api/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct Release {
pub bundle_prn: String,
pub cohort_prn: String,
pub description: Option<String>,
pub disabled: Option<bool>,
pub inserted_at: String,
pub name: String,
pub next_release_prn: Option<String>,
Expand All @@ -33,6 +34,7 @@ pub struct CreateReleaseParams {
pub bundle_prn: String,
pub cohort_prn: String,
pub description: Option<String>,
pub disabled: Option<bool>,
pub name: String,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
Expand Down Expand Up @@ -93,6 +95,9 @@ pub struct UpdateReleaseParams {
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
pub disabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
Expand Down
3 changes: 2 additions & 1 deletion tests/fixtures/devices-authenticate-200.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"tag-2"
],
"status": "offline",
"version": "1.0.0"
"version": "1.0.0",
"prn": "prn"
}
}
5 changes: 3 additions & 2 deletions tests/fixtures/devices-create-201.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
],
"status": "offline",
"version": "1.0.0",
"target": "test-target"
"target": "test-target",
"prn": "prn"
}
}
}
3 changes: 2 additions & 1 deletion tests/fixtures/devices-get-200.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"tag-1",
"tag-2"
],
"version": "1.0.0"
"version": "1.0.0",
"prn": "prn"
}
}
6 changes: 4 additions & 2 deletions tests/fixtures/devices-list-200.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"tag-1",
"tag-2"
],
"version": "1.0.0"
"version": "1.0.0",
"prn": "prn"
},
{
"description": "test-2",
Expand All @@ -46,7 +47,8 @@
"tag-3",
"tag-4"
],
"version": "1.0.0"
"version": "1.0.0",
"prn": "prn"
}
]
}
3 changes: 2 additions & 1 deletion tests/fixtures/devices-update-200.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"tag-2"
],
"status": "offline",
"version": "1.0.0"
"version": "1.0.0",
"prn": "prn"
}
}
4 changes: 3 additions & 1 deletion tests/releases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async fn create_release() {
ca_bundle_path: None,
});

let m = mock("POST", &*format!("/releases"))
let m = mock("POST", &*"/releases".to_string())
.with_status(201)
.with_header("content-type", "application/json")
.with_body_from_file("tests/fixtures/releases-create-201.json")
Expand All @@ -39,6 +39,7 @@ async fn create_release() {
bundle_prn: expected_bundle_prn.to_string(),
cohort_prn: expected_cohort_prn.to_string(),
description: Some(expected_description.to_string()),
disabled: None,
name: expected_name.to_string(),
next_release_prn: Some(expected_next_release_prn.to_string()),
organization_prn: expected_organization_prn.to_string(),
Expand Down Expand Up @@ -183,6 +184,7 @@ async fn update_release() {
let params = UpdateReleaseParams {
prn: expected_prn.to_string(),
description: Some(expected_description.to_string()),
disabled: None,
name: Some(expected_name.to_string()),
next_release_prn: Some(expected_next_release_prn.to_string()),
phase_mode: None,
Expand Down

0 comments on commit 1e03a5b

Please sign in to comment.