summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2010-09-24 16:26:46 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2010-09-24 16:26:46 +0000
commitdeed1b949d6340c87a2cee9cca411e70d908eaf4 (patch)
tree7b6f81ef08306483f0490bb16ea00f9a7da4d693 /test
parent20305418f475abced81843a847d1192a74647f69 (diff)
downloadredmine-deed1b949d6340c87a2cee9cca411e70d908eaf4.tar.gz
redmine-deed1b949d6340c87a2cee9cca411e70d908eaf4.zip
Refactor: move NewsController#preview to PreviewsController#news
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4174 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/functional/news_controller_test.rb11
-rw-r--r--test/functional/previews_controller_test.rb10
-rw-r--r--test/integration/routing_test.rb6
3 files changed, 15 insertions, 12 deletions
diff --git a/test/functional/news_controller_test.rb b/test/functional/news_controller_test.rb
index 219c4d7a7..30ca5a26e 100644
--- a/test/functional/news_controller_test.rb
+++ b/test/functional/news_controller_test.rb
@@ -117,15 +117,4 @@ class NewsControllerTest < ActionController::TestCase
assert_redirected_to 'projects/ecookbook/news'
assert_nil News.find_by_id(1)
end
-
- def test_preview
- get :preview, :project_id => 1,
- :news => {:title => '',
- :description => 'News description',
- :summary => ''}
- assert_response :success
- assert_template 'common/_preview'
- assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
- :content => /News description/
- end
end
diff --git a/test/functional/previews_controller_test.rb b/test/functional/previews_controller_test.rb
index 63456d1d0..4140f1428 100644
--- a/test/functional/previews_controller_test.rb
+++ b/test/functional/previews_controller_test.rb
@@ -19,4 +19,14 @@ class PreviewsControllerTest < ActionController::TestCase
assert_not_nil assigns(:notes)
end
+ def test_news
+ get :news, :project_id => 1,
+ :news => {:title => '',
+ :description => 'News description',
+ :summary => ''}
+ assert_response :success
+ assert_template 'common/_preview'
+ assert_tag :tag => 'fieldset', :attributes => { :class => 'preview' },
+ :content => /News description/
+ end
end
diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb
index 3376f9313..be12dd027 100644
--- a/test/integration/routing_test.rb
+++ b/test/integration/routing_test.rb
@@ -157,10 +157,14 @@ class RoutingTest < ActionController::IntegrationTest
should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
-
+ should_route :get, "/news/123/preview", :controller => 'previews', :action => 'news', :id => '123'
+ should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
+
should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
should_route :post, "/news/567/destroy", :controller => 'news', :action => 'destroy', :id => '567'
should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
+
+ should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
should_route :put, "/news/567/edit", :controller => 'news', :action => 'update', :id => '567'