|
|
@ -157,10 +157,7 @@ describe "POST /api/v3/queries/form", type: :request do |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
it 'has the project set' do |
|
|
|
it 'has the project set' do |
|
|
|
project_link = { |
|
|
|
project_link = { "href" => "/api/v3/projects/#{project.id}" } |
|
|
|
"href" => "/api/v3/projects/#{project.id}", |
|
|
|
|
|
|
|
"title" => project.name |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(form.dig("_embedded", "payload", "_links", "project")).to eq project_link |
|
|
|
expect(form.dig("_embedded", "payload", "_links", "project")).to eq project_link |
|
|
|
end |
|
|
|
end |
|
|
@ -209,6 +206,24 @@ describe "POST /api/v3/queries/form", type: :request do |
|
|
|
expect(form.dig("_embedded", "payload", "_links", "sortBy")).to eq sort_by |
|
|
|
expect(form.dig("_embedded", "payload", "_links", "sortBy")).to eq sort_by |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
context "with the project referred to by its identifier" do |
|
|
|
|
|
|
|
let(:override_params) do |
|
|
|
|
|
|
|
links = parameters[:_links] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
links[:project] = { |
|
|
|
|
|
|
|
href: "/api/v3/projects/#{project.id}" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ _links: links } |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it "still finds the project" do |
|
|
|
|
|
|
|
project_link = { "href" => "/api/v3/projects/#{project.id}" } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expect(form.dig("_embedded", "payload", "_links", "project")).to eq project_link |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
context "with an unknown filter" do |
|
|
|
context "with an unknown filter" do |
|
|
|
let(:override_params) do |
|
|
|
let(:override_params) do |
|
|
|
filter = parameters[:filters][0] |
|
|
|
filter = parameters[:filters][0] |
|
|
|