def test_load_descriptor(frameworks_skills_client): c = frameworks_skills_client skill_1 = ApiHelper.post_a_skill(c, "skill1") skill_2 = ApiHelper.post_a_skill(c, "skill2") skills_list = [skill_1, skill_2] framework_id = ApiHelper.post_a_framework(c, skills_list) ApiHelper.check_for_skills_on_framework(c, framework_id, skills_list)
def test_mn_delete_one(frameworks_skills_client): c = frameworks_skills_client skill_1 = ApiHelper.post_a_skill(c, "skill1") skill_2 = ApiHelper.post_a_skill(c, "skill2") skills_list = [skill_1, skill_2] framework_id = ApiHelper.post_a_framework(c, skills_list) resp = ApiHelper.delete_a_framework_skill(c, framework_id, [skill_1]) expect(resp["skills"]).to(equal([skill_2]))
def test_mn_put(frameworks_skills_client): c = frameworks_skills_client skill_1 = ApiHelper.post_a_skill(c, "skill1") skill_2 = ApiHelper.post_a_skill(c, "skill2") skills_list = [skill_1, skill_2] skill_3 = ApiHelper.post_a_skill(c, "skill3") framework_id = ApiHelper.post_a_framework(c, skills_list) ApiHelper.put_a_framework_skill(c, framework_id, [skill_3]) ApiHelper.check_for_skills_on_framework(c, framework_id, [skill_3])
def test_mn_delete_relationship_that_does_not_exist(frameworks_skills_client): c = frameworks_skills_client skill_1 = ApiHelper.post_a_skill(c, "skill1") skill_2 = ApiHelper.post_a_skill(c, "skill2") skill_3 = ApiHelper.post_a_skill(c, "skill3") skills_list = [skill_1, skill_2] framework_id = ApiHelper.post_a_framework(c, skills_list) resp = ApiHelper.delete_a_framework_skill(c, framework_id, [skill_3]) expect(resp["skills"]).to(equal([skill_1, skill_2]))
def test_mn_reverse_relationship(frameworks_skills_client): c = frameworks_skills_client skill_1 = ApiHelper.post_a_skill(c, "skill1") framework_id = ApiHelper.post_a_framework(c, [skill_1]) resp = ApiHelper.get_frameworks_on_skill(c, skill_1) expect(resp["frameworks"]).to(equal([framework_id]))