Skip to content

Instantly share code, notes, and snippets.

@willawill
Created September 21, 2015 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willawill/824bff4b6a6d0e5a17af to your computer and use it in GitHub Desktop.
Save willawill/824bff4b6a6d0e5a17af to your computer and use it in GitHub Desktop.
it "sorts the applications by the stage" do
+ first_stage = create(:phone_interview_stage, :hiring_plan => hiring_plan)
+ second_stage = create(:face_to_face_stage, :hiring_plan => hiring_plan)
+
+ first_application = create(:application)
+ first_application.current_application_stage = ApplicationStage.create(hiring_plan_interview_stage: first_stage, application: first_application)
+ first_application.save!
+ second_application = create(:application)
+ second_application.current_application_stage = ApplicationStage.create(hiring_plan_interview_stage: second_stage, application: second_application)
+ second_application.save!
+
+ post :generate_email,
+ :selected_stage_names => [first_stage.name, second_stage.name],
+ :selected_job_ids => [hiring_plan.id]
+
+ expect(assigns(:applications)).to eq [first_application, second_application]
+ end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment