Skip to content

Commit

Permalink
Added /api/v1/taxon_names/autocomplete endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
LocoDelAssembly committed Jun 5, 2019
1 parent 42e1094 commit 8c00e8f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/routes/api_v1.rb
Expand Up @@ -29,6 +29,7 @@
get '/otus', to: '/otus#index'

get '/taxon_names', to: '/taxon_names#api_index'
get '/taxon_names/autocomplete', to: '/taxon_names#autocomplete'
get '/taxon_names/:id', to: '/taxon_names#api_show'
end

Expand Down
7 changes: 6 additions & 1 deletion spec/requests/api/v1/rest/taxon_name_spec.rb
Expand Up @@ -2,7 +2,7 @@

describe 'Api::V1::TaxonNames', type: :request do

context 'taxon_names/index' do
context 'taxon_names' do

# let(:taxon_name) { FactoryBot.create(:valid_taxon_name) }
# let(:headers) { { "Authorization": 'Token token=' + user.api_access_token, project_id: taxon_name.project_id } }
Expand All @@ -15,6 +15,11 @@
before { get path, headers: headers, params: { project_id: taxon_name.project_id } }
it_behaves_like 'a successful response'
end
end

context 'taxon_names/autocomplete' do

it_behaves_like 'secured by both user and project token', :valid_taxon_name, '/api/v1/taxon_names/autocomplete'

end
end

0 comments on commit 8c00e8f

Please sign in to comment.