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 / .svn / pristine / 18 / 18e8c38332487b5baaa2a884c66c256e8b7f9e68.svn-base @ 912:5e80956cc792

History | View | Annotate | Download (881 Bytes)

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

    
3
class ApiTest::HttpBasicLoginWithApiTokenTest < ActionController::IntegrationTest
4
  fixtures :projects, :trackers, :issue_statuses, :issues,
5
           :enumerations, :users, :issue_categories,
6
           :projects_trackers,
7
           :roles,
8
           :member_roles,
9
           :members,
10
           :enabled_modules,
11
           :workflows
12

    
13
  def setup
14
    Setting.rest_api_enabled = '1'
15
    Setting.login_required = '1'
16
  end
17

    
18
  def teardown
19
    Setting.rest_api_enabled = '0'
20
    Setting.login_required = '0'
21
  end
22

    
23
  # Using the NewsController because it's a simple API.
24
  context "get /news" do
25

    
26
    context "in :xml format" do
27
      should_allow_http_basic_auth_with_key(:get, "/news.xml")
28
    end
29

    
30
    context "in :json format" do
31
      should_allow_http_basic_auth_with_key(:get, "/news.json")
32
    end
33
  end
34
end