summaryrefslogtreecommitdiff
path: root/test/functional/api/identities_controller_test.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-05-18 21:00:42 +0200
committerAzul <azul@riseup.net>2016-05-20 16:35:55 +0200
commite542a3056c27fd662ef767b6720861035f6dbb1c (patch)
tree45d0d16069a7820a58583423956c8cc4f5f64819 /test/functional/api/identities_controller_test.rb
parent83f59164fc069f2593cf6babbc18638d9a68c9a3 (diff)
api: set defaults for version in routes
This way we do not need to specify it all the times. In the functional tests defaults do not get added automatically. Introduced api_{get,put,post,delete} to add format and version default. One to two functional tests failing, everything else passes.
Diffstat (limited to 'test/functional/api/identities_controller_test.rb')
-rw-r--r--test/functional/api/identities_controller_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/api/identities_controller_test.rb b/test/functional/api/identities_controller_test.rb
index e803ee7..57345c8 100644
--- a/test/functional/api/identities_controller_test.rb
+++ b/test/functional/api/identities_controller_test.rb
@@ -1,15 +1,15 @@
require_relative '../../test_helper'
-class Api::IdentitiesControllerTest < ActionController::TestCase
+class Api::IdentitiesControllerTest < ApiControllerTest
test "api monitor can fetch identity" do
monitor_auth do
identity = FactoryGirl.create :identity
- get :show, :id => identity.address, :format => 'json'
+ api_get :show, :id => identity.address, :format => 'json'
assert_response :success
assert_equal identity, assigns(:identity)
- get :show, :id => "blahblahblah", :format => 'json'
+ api_get :show, :id => "blahblahblah", :format => 'json'
assert_response :not_found
end
end
@@ -17,7 +17,7 @@ class Api::IdentitiesControllerTest < ActionController::TestCase
test "anonymous cannot fetch identity" do
identity = FactoryGirl.create :identity
- get :show, :id => identity.address, :format => 'json'
+ api_get :show, :id => identity.address, :format => 'json'
assert_response :forbidden
end