Browse Source

begin_curator_applicant_review_success: assert opening in review period

Mokhtar Naamani 5 years ago
parent
commit
879e991fa3
1 changed files with 20 additions and 0 deletions
  1. 20 0
      src/content_working_group/tests.rs

+ 20 - 0
src/content_working_group/tests.rs

@@ -452,6 +452,26 @@ fn begin_curator_applicant_review_success() {
              * TODO: add assertion abouot side-effect in hiring module,
              * this is where state of application has fundamentally changed.
              */
+
+            // Assert opening is in opening stage... hiring::ActiveOpeningStage::ReviewPeriod
+            let opening = <hiring::OpeningById<Test>>::get(&normal_opening_constructed.curator_opening_id);
+            match opening.stage {
+                hiring::OpeningStage::Active {
+                    stage, applications_added, active_application_count, unstaking_application_count, deactivated_application_count
+                } => {
+                    match stage {
+                        hiring::ActiveOpeningStage::ReviewPeriod {
+                            started_accepting_applicants_at_block,
+                            started_review_period_at_block
+                        } => { /* OK */
+                            // assert_eq!(started_accepting_applicants_at_block, 0);
+                            assert_eq!(started_review_period_at_block, System::block_number());
+                        },
+                        _ => panic!("ActiveOpeningStage must be in ReviewPeriod")
+                    }
+                },
+                _ => panic!("OpeningStage must be Active")
+            };
         });
 }