From 92a96ace7e6f6e67c02165d16827f0b9080a5a86 Mon Sep 17 00:00:00 2001 From: Mathis Burger Date: Tue, 19 Nov 2024 23:12:43 +0100 Subject: [PATCH] test: Fixed tests --- tasky/tests/security/assignment_test.rs | 11 ----------- tasky/tests/security/group_test.rs | 18 ------------------ 2 files changed, 29 deletions(-) diff --git a/tasky/tests/security/assignment_test.rs b/tasky/tests/security/assignment_test.rs index 5bca95b..314b7f4 100644 --- a/tasky/tests/security/assignment_test.rs +++ b/tasky/tests/security/assignment_test.rs @@ -18,7 +18,6 @@ fn test_create_assignment_disabled() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -45,7 +44,6 @@ fn test_read_assignment_as_wrong_student() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -72,7 +70,6 @@ fn test_read_assignment_as_student() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -99,7 +96,6 @@ fn test_read_assignment_as_wrong_tutor() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -126,7 +122,6 @@ fn test_read_assignment_as_tutor() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -153,7 +148,6 @@ fn test_read_assignment_as_admin() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -180,7 +174,6 @@ fn test_update_assignment_as_wrong_student() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -207,7 +200,6 @@ fn test_update_assignment_as_student() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -234,7 +226,6 @@ fn test_update_assignment_as_wrong_tutor() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -261,7 +252,6 @@ fn test_update_assignment_as_tutor() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), @@ -288,7 +278,6 @@ fn test_update_assignment_as_admin() { group_id: 1, description: "".to_string(), language: AssignmentLanguage::Golang, - completed_by: vec![], file_structure: None, runner_cmd: "".to_string(), runner_memory: "".to_string(), diff --git a/tasky/tests/security/group_test.rs b/tasky/tests/security/group_test.rs index a9e84d6..44ca929 100644 --- a/tasky/tests/security/group_test.rs +++ b/tasky/tests/security/group_test.rs @@ -17,7 +17,6 @@ fn test_create_group() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 1, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -35,7 +34,6 @@ fn test_read_group_as_admin() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 1, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -53,7 +51,6 @@ fn test_read_group_as_tutor() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 1, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -71,7 +68,6 @@ fn test_read_group_as_wrong_tutor() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -89,7 +85,6 @@ fn test_read_group_as_student() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![Some(1)], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -107,7 +102,6 @@ fn test_read_group_as_wrong_student() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -125,7 +119,6 @@ fn test_update_as_admin() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -143,7 +136,6 @@ fn test_update_as_tutor() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 1, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -161,7 +153,6 @@ fn test_update_as_wrong_tutor() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -179,7 +170,6 @@ fn test_update_as_student() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -197,7 +187,6 @@ fn test_delete_as_admin() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -215,7 +204,6 @@ fn test_delete_as_tutor() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 1, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -233,7 +221,6 @@ fn test_delete_as_wrong_tutor() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -251,7 +238,6 @@ fn test_delete_as_student() { let mut group = Group { id: 1, title: "group".to_string(), - members: vec![], tutor: 2, join_policy: JoinRequestPolicy::Request, created_at: NaiveDateTime::parse_from_str("2015-09-05 23:56:04", "%Y-%m-%d %H:%M:%S") @@ -269,7 +255,6 @@ fn test_create_create_as_student() { let mut create = CreateGroup { title: "".to_string(), tutor: 1, - members: vec![], join_policy: JoinRequestPolicy::Request, }; assert_eq!(create.is_granted(SecurityAction::Create, &user), false); @@ -281,7 +266,6 @@ fn test_create_create_as_tutor() { let mut create = CreateGroup { title: "".to_string(), tutor: 1, - members: vec![], join_policy: JoinRequestPolicy::Request, }; assert_eq!(create.is_granted(SecurityAction::Create, &user), true); @@ -293,7 +277,6 @@ fn test_create_create_as_admin() { let mut create = CreateGroup { title: "".to_string(), tutor: 1, - members: vec![], join_policy: JoinRequestPolicy::Request, }; assert_eq!(create.is_granted(SecurityAction::Create, &user), false); @@ -305,7 +288,6 @@ fn test_create_create_pending() { let mut create = CreateGroup { title: "".to_string(), tutor: 1, - members: vec![], join_policy: JoinRequestPolicy::Request, }; assert_eq!(create.is_granted(SecurityAction::Read, &user), false);