To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / test / integration / api_test / http_basic_login_with_api_token_test.rb @ 441:cbce1fd3b1b7

History | View | Annotate | Download (639 Bytes)

1
require File.expand_path('../../../test_helper', __FILE__)
2

    
3
class ApiTest::HttpBasicLoginWithApiTokenTest < 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

    
19
    context "in :xml format" do
20
      should_allow_http_basic_auth_with_key(:get, "/news.xml")
21
    end
22

    
23
    context "in :json format" do
24
      should_allow_http_basic_auth_with_key(:get, "/news.json")
25
    end
26
  end
27
end