Permalink
Browse files

added tests for case-sensitive position rendering

  • Loading branch information...
1 parent bb07945 commit d630d0e0b136e8f4c391a2bb1b7ec93f0fac1526 Jen Fong-Adwent committed Jan 6, 2012
Showing with 26 additions and 4 deletions.
  1. +26 −4 apps/careers/tests/test_views.py
View
30 apps/careers/tests/test_views.py
@@ -13,8 +13,7 @@ class CareersTest(TestCase):
fixtures = ['django_jobvite.json']
def test_homepage(self):
- """
- Test that homepage exists and
+ """Test that homepage exists and
categories and their positions
also exist.
"""
@@ -26,8 +25,7 @@ def test_homepage(self):
assert doc('.role-group.large ul li')
def test_position_detail(self):
- """
- Test that the position page contains
+ """Test that the position page contains
a job description and an apply button
"""
position = Position.objects.filter(pk=1)
@@ -38,3 +36,27 @@ def test_position_detail(self):
doc = pq(r.content)
eq_('http://hire.jobvite.com/CompanyJobs/Apply.aspx?c=qpX9Vfwa&j=oPVSVfwh',
doc.find('#job-apply').attr('href'))
+
+ def test_position_case_sensitive_match(self):
+ """Validate that a position match is returned
+ from a case-sensitive job id and it doesn't raise
+ a multiple records error.
+ """
+ job_id_a = 'oflWVfwb'
+ job_id_b = 'oFlWVfwB'
+
+ url = reverse('careers.position', kwargs={'job_id': job_id_a})
+ r = self.client.get(url, follow=True)
+ eq_(r.status_code, 200)
+
+ doc = pq(r.content)
+ eq_('Mozilla Firefox College: 2012 Intern - User Experience Design',
+ doc.find('h1').text())
+
+ url = reverse('careers.position', kwargs={'job_id': job_id_b})
+ r = self.client.get(url, follow=True)
+ eq_(r.status_code, 200)
+
+ doc = pq(r.content)
+ eq_('Mozilla Firefox College: 2012 Intern - Labs Engineering',
+ doc.find('h1').text())

0 comments on commit d630d0e

Please sign in to comment.