Skip to content

Commit

Permalink
201 to 204
Browse files Browse the repository at this point in the history
  • Loading branch information
terrywbrady committed Dec 18, 2023
1 parent b7a4628 commit e515968
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/collection_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def local_id_search
@results = find_by_localid(collection_ark, params[:terms])
return render_object_info(@results[0].ark) if @results.length == 1
end
render status: 201, json: {}.to_json
render status: 204, json: {}.to_json
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/owner_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def search_results
@results = find_by_file_name(@request_owner, term) if @results.empty?
@results = find_by_full_text(@request_owner, terms) if @results.empty?
end
render status: @results.empty? ? 201 : 200
render status: @results.empty? ? 204 : 200
end

private
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/collection_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
mock_permissions_all(user_id, collection_id)
request.session.merge!({ uid: user_id })
get(:local_id_search, params: { group: @collection.group, terms: 'my-local-id-not-found' })
expect(response.status).to eq(201)
expect(response.status).to eq(204)
end

it 'localid search - result found' do
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/owner_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ def mock_owner_name(name)
mock_owner_name(@owner.name)
request.session.merge!({ uid: user_id })
get(:search_results, params: { terms: 'my-local-id-not-found', owner: @owner.name })
expect(response.status).to eq(201)
expect(response.status).to eq(204)
end

it 'empty terms search no results' do
mock_permissions_all(user_id, collection_id)
mock_owner_name(@owner.name)
request.session.merge!({ uid: user_id })
get(:search_results, params: { terms: '', owner: @owner.name })
expect(response.status).to eq(201)
expect(response.status).to eq(204)
end

it 'localid search - result found' do
Expand Down

0 comments on commit e515968

Please sign in to comment.