Verified Commit fd09d9fe authored by Adrienne Cohea's avatar Adrienne Cohea 🌷

Add tests.

parent 908ad75b
Pipeline #194676 failed with stages
in 6 minutes and 2 seconds
......@@ -39,3 +39,36 @@ impl<'a> Endpoint for ProjectReleases<'a> {
}
impl<'a> Pageable for ProjectReleases<'a> {}
#[cfg(test)]
mod tests {
use crate::api::projects::releases::ProjectReleases;
use crate::api::{self, Query};
use crate::test::client::{ExpectedUrl, SingleTestClient};
#[test]
fn project_is_needed() {
let err = ProjectReleases::builder().build().unwrap_err();
assert_eq!(err, "`project` must be initialized");
}
#[test]
fn project_is_sufficient() {
ProjectReleases::builder().project(1).build().unwrap();
}
#[test]
fn endpoint() {
let endpoint = ExpectedUrl::builder()
.endpoint("projects/project/releases")
.build()
.unwrap();
let client = SingleTestClient::new_raw(endpoint, "");
let endpoint = ProjectReleases::builder()
.project("project")
.build()
.unwrap();
api::ignore(endpoint).query(&client).unwrap();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment