Skip to content

Commit

Permalink
Merge pull request #5552 from samvera/5551-child-search
Browse files Browse the repository at this point in the history
Ensure excluded work id is a String
  • Loading branch information
elrayle authored Mar 17, 2022
2 parents c084ac5 + b4c8eb2 commit f050d8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ HTML Properties:
data: {
autocomplete: 'work',
'autocomplete-url' => Rails.application.routes.url_helpers.qa_path + '/search/find_works',
'exclude-work': f.object.model.id # exclude this item from the result set.
'exclude-work': f.object.model.id.to_s # exclude this item from the result set.
} %>
<a href="#" onclick="return false;" class="btn btn-primary" data-behavior="add-relationship"><%= t('.add') %></a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

# input with add button
expect(rendered).to have_selector('input[data-autocomplete-url="/authorities/search/find_works"]')
expect(rendered).to have_selector("[data-exclude-work='#{work.id}']")
expect(rendered).to have_selector("[data-behavior='add-relationship']")
end
end
Expand All @@ -44,6 +45,7 @@
it "draws the page" do
# input with add button
expect(rendered).to have_selector('input[data-autocomplete-url="/authorities/search/find_works"]')
expect(rendered).to have_selector("[data-exclude-work='#{work.id}']")
expect(rendered).to have_selector("[data-behavior='add-relationship']")

# generate the json to drive the script
Expand Down

0 comments on commit f050d8f

Please sign in to comment.