summaryrefslogtreecommitdiff
path: root/test/functional/v1/identities_controller_test.rb
blob: 3e884025e172845f2bf8ad07b91f0bcea51e646e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require_relative '../../test_helper'

class V1::IdentitiesControllerTest < ActionController::TestCase

  test "api monitor can fetch identity" do
    monitor_auth do
      identity = FactoryGirl.create :identity
      get :show, :id => identity.address, :format => 'json'
      assert_response :success
      assert_equal identity, assigns(:identity)
    end
  end

  test "anonymous cannot fetch identity" do
    identity = FactoryGirl.create :identity
    get :show, :id => identity.address, :format => 'json'
    assert_response :forbidden
  end

end