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