To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / .svn / pristine / cf / cf0bca266fbc21a03db30e949b23e76b71b26da6.svn-base @ 1297:0a574315af3e
History | View | Annotate | Download (853 Bytes)
| 1 |
require File.expand_path('../../../test_helper', __FILE__)
|
|---|---|
| 2 |
|
| 3 |
class ApiTest::TokenAuthenticationTest < 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 |
context "in :xml format" do |
| 26 |
should_allow_key_based_auth(:get, "/news.xml") |
| 27 |
end |
| 28 |
|
| 29 |
context "in :json format" do |
| 30 |
should_allow_key_based_auth(:get, "/news.json") |
| 31 |
end |
| 32 |
end |
| 33 |
end |