@@ -1,31 +1,38 | |||
|
1 | 1 | require File.expand_path('../../../test_helper', __FILE__) |
|
2 | 2 | |
|
3 | 3 | class ApiTest::HttpBasicLoginTest < 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 | setup do |
|
19 | 26 | project = Project.find('onlinestore') |
|
20 | 27 | EnabledModule.create(:project => project, :name => 'news') |
|
21 | 28 | end |
|
22 | 29 | |
|
23 | 30 | context "in :xml format" do |
|
24 | 31 | should_allow_http_basic_auth_with_username_and_password(:get, "/projects/onlinestore/news.xml") |
|
25 | 32 | end |
|
26 | 33 | |
|
27 | 34 | context "in :json format" do |
|
28 | 35 | should_allow_http_basic_auth_with_username_and_password(:get, "/projects/onlinestore/news.json") |
|
29 | 36 | end |
|
30 | 37 | end |
|
31 | 38 | end |
General Comments 0
You need to be logged in to leave comments.
Login now