remove trailing white-spaces from test/integration/api_test/news_test.rb.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6673 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-08-27 10:03:37 +00:00
parent 1762486c23
commit 50f7af6b93
1 changed files with 12 additions and 12 deletions

View File

@ -1,16 +1,16 @@
# Redmine - project management software # Redmine - project management software
# Copyright (C) 2006-2010 Jean-Philippe Lang # Copyright (C) 2006-2011 Jean-Philippe Lang
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version. # of the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@ -28,7 +28,7 @@ class ApiTest::NewsTest < ActionController::IntegrationTest
context ".xml" do context ".xml" do
should "return news" do should "return news" do
get '/news.xml' get '/news.xml'
assert_tag :tag => 'news', assert_tag :tag => 'news',
:attributes => {:type => 'array'}, :attributes => {:type => 'array'},
:child => { :child => {
@ -40,11 +40,11 @@ class ApiTest::NewsTest < ActionController::IntegrationTest
} }
end end
end end
context ".json" do context ".json" do
should "return news" do should "return news" do
get '/news.json' get '/news.json'
json = ActiveSupport::JSON.decode(response.body) json = ActiveSupport::JSON.decode(response.body)
assert_kind_of Hash, json assert_kind_of Hash, json
assert_kind_of Array, json['news'] assert_kind_of Array, json['news']
@ -57,10 +57,10 @@ class ApiTest::NewsTest < ActionController::IntegrationTest
context "GET /projects/:project_id/news" do context "GET /projects/:project_id/news" do
context ".xml" do context ".xml" do
should_allow_api_authentication(:get, "/projects/onlinestore/news.xml") should_allow_api_authentication(:get, "/projects/onlinestore/news.xml")
should "return news" do should "return news" do
get '/projects/ecookbook/news.xml' get '/projects/ecookbook/news.xml'
assert_tag :tag => 'news', assert_tag :tag => 'news',
:attributes => {:type => 'array'}, :attributes => {:type => 'array'},
:child => { :child => {
@ -72,13 +72,13 @@ class ApiTest::NewsTest < ActionController::IntegrationTest
} }
end end
end end
context ".json" do context ".json" do
should_allow_api_authentication(:get, "/projects/onlinestore/news.json") should_allow_api_authentication(:get, "/projects/onlinestore/news.json")
should "return news" do should "return news" do
get '/projects/ecookbook/news.json' get '/projects/ecookbook/news.json'
json = ActiveSupport::JSON.decode(response.body) json = ActiveSupport::JSON.decode(response.body)
assert_kind_of Hash, json assert_kind_of Hash, json
assert_kind_of Array, json['news'] assert_kind_of Array, json['news']
@ -87,7 +87,7 @@ class ApiTest::NewsTest < ActionController::IntegrationTest
end end
end end
end end
def credentials(user, password=nil) def credentials(user, password=nil)
ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user) ActionController::HttpAuthentication::Basic.encode_credentials(user, password || user)
end end