@@ -5,12 +5,12 | |||
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 |
# |
|
|
8 | # | |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 |
# |
|
|
13 | # | |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
@@ -24,26 +24,26 class JournalsController; def rescue_action(e) raise e end; end | |||
|
24 | 24 | class JournalsControllerTest < ActionController::TestCase |
|
25 | 25 | fixtures :projects, :users, :members, :member_roles, :roles, :issues, :journals, :journal_details, :enabled_modules, |
|
26 | 26 | :trackers, :issue_statuses, :enumerations, :custom_fields, :custom_values, :custom_fields_projects |
|
27 | ||
|
27 | ||
|
28 | 28 | def setup |
|
29 | 29 | @controller = JournalsController.new |
|
30 | 30 | @request = ActionController::TestRequest.new |
|
31 | 31 | @response = ActionController::TestResponse.new |
|
32 | 32 | User.current = nil |
|
33 | 33 | end |
|
34 | ||
|
34 | ||
|
35 | 35 | def test_index |
|
36 | 36 | get :index, :project_id => 1 |
|
37 | 37 | assert_response :success |
|
38 | 38 | assert_not_nil assigns(:journals) |
|
39 | 39 | assert_equal 'application/atom+xml', @response.content_type |
|
40 | 40 | end |
|
41 | ||
|
41 | ||
|
42 | 42 | def test_diff |
|
43 | 43 | get :diff, :id => 3, :detail_id => 4 |
|
44 | 44 | assert_response :success |
|
45 | 45 | assert_template 'diff' |
|
46 | ||
|
46 | ||
|
47 | 47 | assert_tag 'span', |
|
48 | 48 | :attributes => {:class => 'diff_out'}, |
|
49 | 49 | :content => /removed/ |
@@ -51,14 +51,14 class JournalsControllerTest < ActionController::TestCase | |||
|
51 | 51 | :attributes => {:class => 'diff_in'}, |
|
52 | 52 | :content => /added/ |
|
53 | 53 | end |
|
54 | ||
|
54 | ||
|
55 | 55 | def test_reply_to_issue |
|
56 | 56 | @request.session[:user_id] = 2 |
|
57 | 57 | get :new, :id => 6 |
|
58 | 58 | assert_response :success |
|
59 | 59 | assert_select_rjs :show, "update" |
|
60 | 60 | end |
|
61 | ||
|
61 | ||
|
62 | 62 | def test_reply_to_issue_without_permission |
|
63 | 63 | @request.session[:user_id] = 7 |
|
64 | 64 | get :new, :id => 6 |
@@ -81,7 +81,7 class JournalsControllerTest < ActionController::TestCase | |||
|
81 | 81 | assert_select 'textarea' |
|
82 | 82 | end |
|
83 | 83 | end |
|
84 | ||
|
84 | ||
|
85 | 85 | def test_post_edit |
|
86 | 86 | @request.session[:user_id] = 1 |
|
87 | 87 | xhr :post, :edit, :id => 2, :notes => 'Updated notes' |
@@ -89,7 +89,7 class JournalsControllerTest < ActionController::TestCase | |||
|
89 | 89 | assert_select_rjs :replace, 'journal-2-notes' |
|
90 | 90 | assert_equal 'Updated notes', Journal.find(2).notes |
|
91 | 91 | end |
|
92 | ||
|
92 | ||
|
93 | 93 | def test_post_edit_with_empty_notes |
|
94 | 94 | @request.session[:user_id] = 1 |
|
95 | 95 | xhr :post, :edit, :id => 2, :notes => '' |
General Comments 0
You need to be logged in to leave comments.
Login now