Mercurial > hg > soundsoftware-site
annotate test/integration/api_test/token_authentication_test.rb @ 882:9e27d0747c77 bug_97
Close obsolete branch bug_97
| author | Chris Cannam |
|---|---|
| date | Fri, 25 Mar 2011 13:58:03 +0000 |
| parents | 94944d00e43c |
| children | af80e5618e9b |
| rev | line source |
|---|---|
| chris@37 | 1 require "#{File.dirname(__FILE__)}/../../test_helper" |
| chris@37 | 2 |
| chris@37 | 3 class ApiTest::TokenAuthenticationTest < ActionController::IntegrationTest |
| chris@37 | 4 fixtures :all |
| chris@37 | 5 |
| chris@37 | 6 def setup |
| chris@37 | 7 Setting.rest_api_enabled = '1' |
| chris@37 | 8 Setting.login_required = '1' |
| chris@37 | 9 end |
| chris@37 | 10 |
| chris@37 | 11 def teardown |
| chris@37 | 12 Setting.rest_api_enabled = '0' |
| chris@37 | 13 Setting.login_required = '0' |
| chris@37 | 14 end |
| chris@37 | 15 |
| chris@37 | 16 # Using the NewsController because it's a simple API. |
| chris@37 | 17 context "get /news" do |
| chris@37 | 18 context "in :xml format" do |
| chris@37 | 19 should_allow_key_based_auth(:get, "/news.xml") |
| chris@37 | 20 end |
| chris@37 | 21 |
| chris@37 | 22 context "in :json format" do |
| chris@37 | 23 should_allow_key_based_auth(:get, "/news.json") |
| chris@37 | 24 end |
| chris@37 | 25 end |
| chris@37 | 26 end |
