Skip to content
This repository has been archived by the owner on Feb 8, 2018. It is now read-only.

Commit

Permalink
Add a few basic pages tests ahead of #406
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Dec 6, 2012
1 parent 81bd5e5 commit 6698900
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/test_pages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from gittip.testing import serve_request, load, setup_tips


def test_homepage():
actual = serve_request('/').body
expected = "Gittip happens every Thursday."
assert expected in actual, actual

def test_profile():
with load(*setup_tips(("cheese", "puffs", 0))):
expected = "I’m grateful for tips"
actual = serve_request('/cheese/').body
assert expected in actual, actual

def test_widget():
with load(*setup_tips(("cheese", "puffs", 0))):
expected = "javascript: window.open"
actual = serve_request('/cheese/widget.html').body
assert expected in actual, actual


# These hit the network.

def test_github_proxy():
expected = "<b>lgtest</b> has not joined"
actual = serve_request('/on/github/lgtest/').body
assert expected in actual, actual

def test_twitter_proxy():
expected = "<b>Twitter</b> has not joined"
actual = serve_request('/on/twitter/twitter/').body
assert expected in actual, actual

0 comments on commit 6698900

Please sign in to comment.