annotate .svn/pristine/cf/cf0bca266fbc21a03db30e949b23e76b71b26da6.svn-base @ 929:5f33065ddc4b redmine-1.3

Update to Redmine SVN rev 9414 on 1.3-stable branch
author Chris Cannam
date Wed, 27 Jun 2012 14:54:18 +0100
parents cbb26bc654de
children
rev   line source
Chris@909 1 require File.expand_path('../../../test_helper', __FILE__)
Chris@909 2
Chris@909 3 class ApiTest::TokenAuthenticationTest < ActionController::IntegrationTest
Chris@909 4 fixtures :projects, :trackers, :issue_statuses, :issues,
Chris@909 5 :enumerations, :users, :issue_categories,
Chris@909 6 :projects_trackers,
Chris@909 7 :roles,
Chris@909 8 :member_roles,
Chris@909 9 :members,
Chris@909 10 :enabled_modules,
Chris@909 11 :workflows
Chris@909 12
Chris@909 13 def setup
Chris@909 14 Setting.rest_api_enabled = '1'
Chris@909 15 Setting.login_required = '1'
Chris@909 16 end
Chris@909 17
Chris@909 18 def teardown
Chris@909 19 Setting.rest_api_enabled = '0'
Chris@909 20 Setting.login_required = '0'
Chris@909 21 end
Chris@909 22
Chris@909 23 # Using the NewsController because it's a simple API.
Chris@909 24 context "get /news" do
Chris@909 25 context "in :xml format" do
Chris@909 26 should_allow_key_based_auth(:get, "/news.xml")
Chris@909 27 end
Chris@909 28
Chris@909 29 context "in :json format" do
Chris@909 30 should_allow_key_based_auth(:get, "/news.json")
Chris@909 31 end
Chris@909 32 end
Chris@909 33 end