comparison test/integration/api_test/token_authentication_test.rb @ 51:371eac10df0b live

* Merge from "cannam" branch. This includes update to Redmine trunk, plus welcome/tip-of-the-day from luisf branch.
author Chris Cannam
date Wed, 24 Nov 2010 12:20:08 +0000
parents 94944d00e43c
children af80e5618e9b
comparison
equal deleted inserted replaced
34:09b1d4349da3 51:371eac10df0b
1 require "#{File.dirname(__FILE__)}/../../test_helper"
2
3 class ApiTest::TokenAuthenticationTest < ActionController::IntegrationTest
4 fixtures :all
5
6 def setup
7 Setting.rest_api_enabled = '1'
8 Setting.login_required = '1'
9 end
10
11 def teardown
12 Setting.rest_api_enabled = '0'
13 Setting.login_required = '0'
14 end
15
16 # Using the NewsController because it's a simple API.
17 context "get /news" do
18 context "in :xml format" do
19 should_allow_key_based_auth(:get, "/news.xml")
20 end
21
22 context "in :json format" do
23 should_allow_key_based_auth(:get, "/news.json")
24 end
25 end
26 end