annotate test/integration/api_test/token_authentication_test.rb @ 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 622f24f53b42 261b3d9a4903
rev   line source
Chris@119 1 require File.expand_path('../../../test_helper', __FILE__)
chris@37 2
chris@37 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@37 12
chris@37 13 def setup
chris@37 14 Setting.rest_api_enabled = '1'
chris@37 15 Setting.login_required = '1'
chris@37 16 end
chris@37 17
chris@37 18 def teardown
chris@37 19 Setting.rest_api_enabled = '0'
chris@37 20 Setting.login_required = '0'
chris@37 21 end
Chris@909 22
chris@37 23 # Using the NewsController because it's a simple API.
chris@37 24 context "get /news" do
chris@37 25 context "in :xml format" do
chris@37 26 should_allow_key_based_auth(:get, "/news.xml")
chris@37 27 end
chris@37 28
chris@37 29 context "in :json format" do
chris@37 30 should_allow_key_based_auth(:get, "/news.json")
chris@37 31 end
chris@37 32 end
chris@37 33 end