##// END OF EJS Templates
not use htmlentities gem in rfpdf plugin (#13138)...
not use htmlentities gem in rfpdf plugin (#13138) Contributed by Jun NAITOH. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11399 e93f8b46-1217-0410-a6f0-8f06a7374b81

File last commit:

r11122:dbe7d6fbfb5b
r11169:d5f1e186f1e8
Show More
disabled_rest_api_test.rb
78 lines | 2.5 KiB | text/x-ruby | RubyLexer
/ test / integration / api_test / disabled_rest_api_test.rb
Jean-Philippe Lang
Adds missing copyright....
r11024 # Redmine - project management software
# Copyright (C) 2006-2013 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jean-Baptiste Barth
Use absolute paths in test/**/* requires for Ruby 1.9.2 compatibility. #4050...
r4395 require File.expand_path('../../../test_helper', __FILE__)
Eric Davis
Added an Admin setting to enable/disable the REST web service. (#3920)...
r3106
Jean-Philippe Lang
Adds a subclass of ActionDispatch::IntegrationTest for API tests....
r11023 class Redmine::ApiTest::DisabledRestApiTest < Redmine::ApiTest::Base
Toshi MARUYAMA
Rails3: replace "all" fixtures at test/integration/api_test/disabled_rest_api_test.rb...
r7395 fixtures :projects, :trackers, :issue_statuses, :issues,
:enumerations, :users, :issue_categories,
:projects_trackers,
:roles,
:member_roles,
:members,
Jean-Philippe Lang
Removed unused fixtures....
r11122 :enabled_modules
Eric Davis
Added an Admin setting to enable/disable the REST web service. (#3920)...
r3106
def setup
Setting.rest_api_enabled = '0'
Setting.login_required = '1'
end
def teardown
Setting.rest_api_enabled = '1'
Setting.login_required = '0'
end
Toshi MARUYAMA
remove trailing white-spaces from test/integration/api_test/disabled_rest_api_test.rb....
r6549
Jean-Philippe Lang
Test cleanup....
r8358 def test_with_a_valid_api_token
Jean-Philippe Lang
Removed #generate_with_protected helper methods....
r9337 @user = User.generate!
Jean-Philippe Lang
Removed some generate! calls....
r8959 @token = Token.create!(:user => @user, :action => 'api')
Eric Davis
Added an Admin setting to enable/disable the REST web service. (#3920)...
r3106
Jean-Philippe Lang
Test cleanup....
r8358 get "/news.xml?key=#{@token.value}"
assert_response :unauthorized
assert_equal User.anonymous, User.current
Toshi MARUYAMA
remove trailing white-spaces from test/integration/api_test/disabled_rest_api_test.rb....
r6549
Jean-Philippe Lang
Test cleanup....
r8358 get "/news.json?key=#{@token.value}"
assert_response :unauthorized
assert_equal User.anonymous, User.current
end
Toshi MARUYAMA
remove trailing white-spaces from test/integration/api_test/disabled_rest_api_test.rb....
r6549
Jean-Philippe Lang
Test cleanup....
r8358 def test_with_valid_username_password_http_authentication
Jean-Philippe Lang
Removed #generate_with_protected helper methods....
r9337 @user = User.generate! do |user|
user.password = 'my_password'
end
Eric Davis
Added an Admin setting to enable/disable the REST web service. (#3920)...
r3106
Jean-Philippe Lang
Test cleanup....
r8358 get "/news.xml", nil, credentials(@user.login, 'my_password')
assert_response :unauthorized
assert_equal User.anonymous, User.current
Toshi MARUYAMA
remove trailing white-spaces from test/integration/api_test/disabled_rest_api_test.rb....
r6549
Jean-Philippe Lang
Test cleanup....
r8358 get "/news.json", nil, credentials(@user.login, 'my_password')
assert_response :unauthorized
assert_equal User.anonymous, User.current
end
Eric Davis
Added an Admin setting to enable/disable the REST web service. (#3920)...
r3106
Jean-Philippe Lang
Test cleanup....
r8358 def test_with_valid_token_http_authentication
Jean-Philippe Lang
Removed #generate_with_protected helper methods....
r9337 @user = User.generate!
Jean-Philippe Lang
Removed some generate! calls....
r8959 @token = Token.create!(:user => @user, :action => 'api')
Eric Davis
Added an Admin setting to enable/disable the REST web service. (#3920)...
r3106
Jean-Philippe Lang
Test cleanup....
r8358 get "/news.xml", nil, credentials(@token.value, 'X')
assert_response :unauthorized
assert_equal User.anonymous, User.current
Toshi MARUYAMA
remove trailing white-spaces from test/integration/api_test/disabled_rest_api_test.rb....
r6549
Jean-Philippe Lang
Test cleanup....
r8358 get "/news.json", nil, credentials(@token.value, 'X')
assert_response :unauthorized
assert_equal User.anonymous, User.current
Eric Davis
Added an Admin setting to enable/disable the REST web service. (#3920)...
r3106 end
end