comparison test/integration/api_test/token_authentication_test.rb @ 37:94944d00e43c

* Update to SVN trunk rev 4411
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Fri, 19 Nov 2010 13:24:41 +0000
parents
children af80e5618e9b
comparison
equal deleted inserted replaced
22:40f7cfd4df19 37:94944d00e43c
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