Mercurial > hg > soundsoftware-site
comparison test/integration/api_test/token_authentication_test.rb @ 41:7f0e922c8982 luisf
merged with new version from trunk
author | luisf |
---|---|
date | Fri, 19 Nov 2010 14:45:28 +0000 |
parents | 94944d00e43c |
children | af80e5618e9b |
comparison
equal
deleted
inserted
replaced
35:67e8aef29de9 | 41:7f0e922c8982 |
---|---|
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 |