Mercurial > hg > soundsoftware-site
comparison test/integration/api_test/token_authentication_test.rb @ 38:33d69fee1d99 cannam
* Merge SVN update from default branch
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Fri, 19 Nov 2010 13:41:40 +0000 |
parents | 94944d00e43c |
children | af80e5618e9b |
comparison
equal
deleted
inserted
replaced
29:192d132064a5 | 38:33d69fee1d99 |
---|---|
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 |