Skip to content

Commit

Permalink
Merge branch 'development' into stage
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 9, 2023
2 parents 3d4f6e0 + d8eb63a commit b1355b1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions controllers/agents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ class AgentsController < ApplicationController
else
agents = query.to_a
end

if includes_param.include?(:all) || includes_param.include?(:usages)
LinkedData::Models::Agent.load_agents_usages(agents)
end

reply agents
end

Expand Down
4 changes: 2 additions & 2 deletions test/controllers/test_agents_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ def teardown
end

def test_all_agents
get '/agents?display=all'
get '/agents?display=all&page=1'
assert last_response.ok?

created_agents = MultiJson.load(last_response.body)
@agents.each do |agent|
created_agent = created_agents.select{|x| x["name"].eql?(agent[:name])}.first
created_agent = created_agents["collection"].select{|x| x["name"].eql?(agent[:name])}.first
refute_nil created_agent
refute_nil created_agent["usages"]
assert_equal agent[:name], created_agent["name"]
Expand Down

0 comments on commit b1355b1

Please sign in to comment.