summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-17 17:29:27 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-10-17 17:29:27 +0000
commitd62b90db7327be488007d382f84c469f9fbe4ffe (patch)
tree153cfe41553b040154ecc89605b797864a76f3c1 /test/functional
parentfcb22595d0e87a2d04fb0210c775efdab6cfffa6 (diff)
downloadredmine-d62b90db7327be488007d382f84c469f9fbe4ffe.tar.gz
redmine-d62b90db7327be488007d382f84c469f9fbe4ffe.zip
Makes enumerations available through the REST API.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10664 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/enumerations_controller_test.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/test/functional/enumerations_controller_test.rb b/test/functional/enumerations_controller_test.rb
index b13fc86f7..dba0720d6 100644
--- a/test/functional/enumerations_controller_test.rb
+++ b/test/functional/enumerations_controller_test.rb
@@ -30,6 +30,12 @@ class EnumerationsControllerTest < ActionController::TestCase
assert_template 'index'
end
+ def test_index_should_require_admin
+ @request.session[:user_id] = nil
+ get :index
+ assert_response 302
+ end
+
def test_new
get :new, :type => 'IssuePriority'
assert_response :success
@@ -48,7 +54,7 @@ class EnumerationsControllerTest < ActionController::TestCase
assert_difference 'IssuePriority.count' do
post :create, :enumeration => {:type => 'IssuePriority', :name => 'Lowest'}
end
- assert_redirected_to '/enumerations?type=IssuePriority'
+ assert_redirected_to '/enumerations'
e = IssuePriority.find_by_name('Lowest')
assert_not_nil e
end
@@ -77,7 +83,7 @@ class EnumerationsControllerTest < ActionController::TestCase
assert_no_difference 'IssuePriority.count' do
put :update, :id => 6, :enumeration => {:type => 'IssuePriority', :name => 'New name'}
end
- assert_redirected_to '/enumerations?type=IssuePriority'
+ assert_redirected_to '/enumerations'
e = IssuePriority.find(6)
assert_equal 'New name', e.name
end