Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Commit

Permalink
Hide invite link for unvouched, fixes bug 687283
Browse files Browse the repository at this point in the history
  • Loading branch information
davedash committed Sep 21, 2011
1 parent c71f86a commit b783a77
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 16 additions & 2 deletions apps/users/tests.py
Expand Up @@ -4,8 +4,8 @@
from phonebook.tests import LDAPTestCase


class TestSearchBox(LDAPTestCase):
"""Verify that the right users see the searchbox."""
class TestThingsForPeople(LDAPTestCase):
"""Verify that the wrong users don't see things."""

def test_searchbox(self):
url = reverse('home')
Expand All @@ -18,3 +18,17 @@ def test_searchbox(self):
r = self.mozillian_client.get(url)
doc = pq(r.content)
assert doc('input[type=search]')

def test_invitelink(self):
url = reverse('home')
r = self.client.get(url)
doc = pq(r.content)
assert not doc('a#invite')
r = self.pending_client.get(url)
doc = pq(r.content)
assert not doc('a#invite'), "Unvouched can't invite."
r = self.mozillian_client.get(url)
doc = pq(r.content)
assert doc('a#invite')


6 changes: 5 additions & 1 deletion templates/base.html
Expand Up @@ -43,7 +43,11 @@ <h1><a href="{{ url('home') }}">{{ _('Mozillians') }}</a></h1>
{{ _('Profile') }}
</a>
</li>
<li><a id="invite" href="{{ url('invite') }}">{{ _('Invite') }}</a></li>
{% if user.is_vouched() %}
<li>
<a id="invite" href="{{ url('invite') }}">{{ _('Invite') }}</a>
</li>
{% endif %}
<li><a id="logout" href="{{ url('logout') }}?next={{ url('login') }}">{{ _('Log Out') }}</a></li>
{% else %}
<li><a id="login" href="{{ url('login') }}">{{ _('Log In') }}</a></li>
Expand Down

0 comments on commit b783a77

Please sign in to comment.