Show More
@@ -70,8 +70,9 b' class JournalController(BaseController):' | |||
|
70 | 70 | return render('/journal.html') |
|
71 | 71 | |
|
72 | 72 | def toggle_following(self): |
|
73 | ||
|
74 |
|
|
|
73 | cur_token = request.POST.get('auth_token') | |
|
74 | token = get_token() | |
|
75 | if cur_token == token: | |
|
75 | 76 | scm_model = ScmModel() |
|
76 | 77 | |
|
77 | 78 | user_id = request.POST.get('follows_user_id') |
@@ -93,5 +94,5 b' class JournalController(BaseController):' | |||
|
93 | 94 | raise HTTPInternalServerError() |
|
94 | 95 | |
|
95 | 96 | |
|
96 | ||
|
97 | log.debug('token mismatch %s vs %s', cur_token, token) | |
|
97 | 98 | raise HTTPInternalServerError() |
@@ -6,6 +6,10 b' class TestHomeController(TestController)' | |||
|
6 | 6 | self.log_user() |
|
7 | 7 | response = self.app.get(url(controller='home', action='index')) |
|
8 | 8 | #if global permission is set |
|
9 |
assert 'ADD NEW REPOSITORY' in response.body, ' |
|
|
9 | assert 'ADD NEW REPOSITORY' in response.body, 'No Button for add new repository' | |
|
10 | 10 | assert 'href="/%s/summary"' % HG_REPO in response.body, ' mising repository in list' |
|
11 | 11 | # Test response... |
|
12 | ||
|
13 | assert """<img class="icon" title="Mercurial repository" alt="Mercurial repository" src="/images/icons/hgicon.png"/>""" in response.body, 'wrong info about type of repositry' | |
|
14 | assert """<img class="icon" title="public repository" alt="public repository" src="/images/icons/lock_open.png"/>""" in response.body, 'wrong info about repository availabilty' | |
|
15 | assert """<a class="tooltip" href="/vcs_test_hg/changeset/27cd5cce30c96924232dffcd24178a07ffeb5dfc" tooltip_title="merge">r173:27cd5cce30c9</a>""" in response.body, 'no info about tooltip' |
@@ -1,7 +1,47 b'' | |||
|
1 | 1 | from rhodecode.tests import * |
|
2 | from rhodecode.model.db import UserFollowing, User, Repository | |
|
3 | from rhodecode.lib.helpers import get_token | |
|
2 | 4 | |
|
3 | 5 | class TestJournalController(TestController): |
|
4 | 6 | |
|
5 | 7 | def test_index(self): |
|
8 | self.log_user() | |
|
6 | 9 | response = self.app.get(url(controller='journal', action='index')) |
|
7 | 10 | # Test response... |
|
11 | assert """<div class="currently_following"> | |
|
12 | ||
|
13 | ||
|
14 | <img class="icon" title="public repository" alt="public repository" src="/images/icons/lock_open.png"/> | |
|
15 | ||
|
16 | <a href="/vcs_test_hg/summary">vcs_test_hg</a> | |
|
17 | ||
|
18 | </div>""" in response.body, 'following repo list' | |
|
19 | ||
|
20 | ||
|
21 | ||
|
22 | def test_stop_following_repository(self): | |
|
23 | session = self.log_user() | |
|
24 | # usr = self.sa.query(User).filter(User.username == 'test_admin').one() | |
|
25 | # repo = self.sa.query(Repository).filter(Repository.repo_name == HG_REPO).one() | |
|
26 | # | |
|
27 | # followings = self.sa.query(UserFollowing)\ | |
|
28 | # .filter(UserFollowing.user == usr)\ | |
|
29 | # .filter(UserFollowing.follows_repository == repo).all() | |
|
30 | # | |
|
31 | # assert len(followings) == 1, 'Not following any repository' | |
|
32 | # | |
|
33 | # response = self.app.post(url(controller='journal', | |
|
34 | # action='toggle_following'), | |
|
35 | # {'auth_token':get_token(session), | |
|
36 | # 'follows_repo_id':repo.repo_id}) | |
|
37 | ||
|
38 | def test_start_following_repository(self): | |
|
39 | self.log_user() | |
|
40 | response = self.app.get(url(controller='journal', action='index'),) | |
|
41 | ||
|
42 | ||
|
43 | def __add_repo(self): | |
|
44 | pass | |
|
45 | ||
|
46 | def __remove_repo(self): | |
|
47 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now