Mercurial > hg > soundsoftware-site
annotate test/integration/api_test/token_authentication_test.rb @ 1327:287f201c2802 redmine-2.2-integration
Add italic
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Wed, 19 Jun 2013 20:56:22 +0100 |
parents | cbb26bc654de |
children | 622f24f53b42 261b3d9a4903 |
rev | line source |
---|---|
Chris@119 | 1 require File.expand_path('../../../test_helper', __FILE__) |
chris@37 | 2 |
chris@37 | 3 class ApiTest::TokenAuthenticationTest < ActionController::IntegrationTest |
Chris@909 | 4 fixtures :projects, :trackers, :issue_statuses, :issues, |
Chris@909 | 5 :enumerations, :users, :issue_categories, |
Chris@909 | 6 :projects_trackers, |
Chris@909 | 7 :roles, |
Chris@909 | 8 :member_roles, |
Chris@909 | 9 :members, |
Chris@909 | 10 :enabled_modules, |
Chris@909 | 11 :workflows |
chris@37 | 12 |
chris@37 | 13 def setup |
chris@37 | 14 Setting.rest_api_enabled = '1' |
chris@37 | 15 Setting.login_required = '1' |
chris@37 | 16 end |
chris@37 | 17 |
chris@37 | 18 def teardown |
chris@37 | 19 Setting.rest_api_enabled = '0' |
chris@37 | 20 Setting.login_required = '0' |
chris@37 | 21 end |
Chris@909 | 22 |
chris@37 | 23 # Using the NewsController because it's a simple API. |
chris@37 | 24 context "get /news" do |
chris@37 | 25 context "in :xml format" do |
chris@37 | 26 should_allow_key_based_auth(:get, "/news.xml") |
chris@37 | 27 end |
chris@37 | 28 |
chris@37 | 29 context "in :json format" do |
chris@37 | 30 should_allow_key_based_auth(:get, "/news.json") |
chris@37 | 31 end |
chris@37 | 32 end |
chris@37 | 33 end |