@@ -1,26 +1,33 | |||
|
1 | 1 | require File.expand_path('../../../test_helper', __FILE__) |
|
2 | 2 | |
|
3 | 3 | class ApiTest::TokenAuthenticationTest < ActionController::IntegrationTest |
|
4 | fixtures :all | |
|
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 | |
|
5 | 12 | |
|
6 | 13 | def setup |
|
7 | 14 | Setting.rest_api_enabled = '1' |
|
8 | 15 | Setting.login_required = '1' |
|
9 | 16 | end |
|
10 | 17 | |
|
11 | 18 | def teardown |
|
12 | 19 | Setting.rest_api_enabled = '0' |
|
13 | 20 | Setting.login_required = '0' |
|
14 | 21 | end |
|
15 | 22 | |
|
16 | 23 | # Using the NewsController because it's a simple API. |
|
17 | 24 | context "get /news" do |
|
18 | 25 | context "in :xml format" do |
|
19 | 26 | should_allow_key_based_auth(:get, "/news.xml") |
|
20 | 27 | end |
|
21 | 28 | |
|
22 | 29 | context "in :json format" do |
|
23 | 30 | should_allow_key_based_auth(:get, "/news.json") |
|
24 | 31 | end |
|
25 | 32 | end |
|
26 | 33 | end |
General Comments 0
You need to be logged in to leave comments.
Login now