Mercurial > hg > soundsoftware-site
comparison test/functional/wiki_controller_test.rb @ 1517:dffacf8a6908 redmine-2.5
Update to Redmine SVN revision 13367 on 2.5-stable branch
author | Chris Cannam |
---|---|
date | Tue, 09 Sep 2014 09:29:00 +0100 |
parents | e248c7af89ec |
children |
comparison
equal
deleted
inserted
replaced
1516:b450a9d58aed | 1517:dffacf8a6908 |
---|---|
159 get :show, :project_id => 1, :id => 'Unexistent page' | 159 get :show, :project_id => 1, :id => 'Unexistent page' |
160 assert_response :success | 160 assert_response :success |
161 assert_template 'edit' | 161 assert_template 'edit' |
162 end | 162 end |
163 | 163 |
164 def test_show_specific_version_of_an_unexistent_page_without_edit_right | |
165 get :show, :project_id => 1, :id => 'Unexistent page', :version => 1 | |
166 assert_response 404 | |
167 end | |
168 | |
164 def test_show_unexistent_page_with_parent_should_preselect_parent | 169 def test_show_unexistent_page_with_parent_should_preselect_parent |
165 @request.session[:user_id] = 2 | 170 @request.session[:user_id] = 2 |
166 get :show, :project_id => 1, :id => 'Unexistent page', :parent => 'Another_page' | 171 get :show, :project_id => 1, :id => 'Unexistent page', :parent => 'Another_page' |
167 assert_response :success | 172 assert_response :success |
168 assert_template 'edit' | 173 assert_template 'edit' |
946 | 951 |
947 def test_add_attachment | 952 def test_add_attachment |
948 @request.session[:user_id] = 2 | 953 @request.session[:user_id] = 2 |
949 assert_difference 'Attachment.count' do | 954 assert_difference 'Attachment.count' do |
950 post :add_attachment, :project_id => 1, :id => 'CookBook_documentation', | 955 post :add_attachment, :project_id => 1, :id => 'CookBook_documentation', |
951 :attachments => {'1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), 'description' => 'test file'}} | 956 :attachments => { |
952 end | 957 '1' => {'file' => uploaded_test_file('testfile.txt', 'text/plain'), |
953 attachment = Attachment.first(:order => 'id DESC') | 958 'description' => 'test file'} |
959 } | |
960 end | |
961 attachment = Attachment.order('id DESC').first | |
954 assert_equal Wiki.find(1).find_page('CookBook_documentation'), attachment.container | 962 assert_equal Wiki.find(1).find_page('CookBook_documentation'), attachment.container |
955 end | 963 end |
956 end | 964 end |