-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds search box to welcome page Co-authored-by: Bess Sadler <bess@users.noreply.github.com> * Returning results past first page Co-authored-by: Bess Sadler <bess@users.noreply.github.com> Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com> --------- Co-authored-by: Bess Sadler <bess@users.noreply.github.com> Co-authored-by: Jane Sandberg <sandbergja@users.noreply.github.com>
- Loading branch information
1 parent
03523d4
commit 3165bd0
Showing
8 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<h1 id="list_header"> GuideCard Index </h1> | ||
|
||
<% @guide_cards.each do |card| %> | ||
<h2> | ||
<% if @exact_match.id == card.id %> | ||
<%= link_to "* #{card.heading}", guide_card_path(card.id) %> | ||
<% else %> | ||
<%= link_to card.heading, guide_card_path(card.id) %> | ||
<% end %> | ||
</h2> | ||
<% end %> | ||
<%= paginate @guide_cards %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
ID,heading,sortid,path,ID,heading,sortid,path | ||
1,*****,1.5,14/0001/A1100,1,*****,1.5,14/0001/A1100 | ||
2,A,2.5,14/0001/B4491,2,A,2.5,14/0001/B4491 | ||
3,AALAS,3.5,14/0001/A1002,3,AALAS,3.5,14/0001/A1002 | ||
4,A.B.C.,4.5,14/0001/A1003,4,A.B.C.,4.5,14/0001/A1003 | ||
5,A.C.I.,5.5,14/0001/A1004,5,A.C.I.,5.5,14/0001/A1004 | ||
6,A-D,6.5,14/0001/A1005,6,A-D,6.5,14/0001/A1005 | ||
7,AGPA,7.5,14/0001/A1006,7,AGPA,7.5,14/0001/A1006 | ||
8,AID,8.5,14/0001/A1007,8,AID,8.5,14/0001/A1007 | ||
9,AILA,9.5,14/0002/A1008,9,AILA,9.5,14/0002/A1008 | ||
10,A.L.,10.5,14/0002/A1009,10,A.L.,10.5,14/0002/A1009 | ||
11,A.M.,11.5,14/0002/A1010,11,A.M.,11.5,14/0002/A1010 | ||
12,APL,12.5,14/0002/A1011,12,APL,12.5,14/0002/A1011 | ||
13,ARS,13.5,14/0002/A1012,13,ARS,13.5,14/0002/A1012 | ||
14,ASM,14.5,14/0002/A1013,14,ASM,14.5,14/0002/A1013 | ||
15,A.T.,15.5,14/0002/A1014,15,A.T.,15.5,14/0002/A1014 | ||
16,Aa,16.5,21/0003/A1015,16,Aa,16.5,21/0003/A1015 | ||
17,Aagaard,17.5,21/0003/A1016,17,Aagaard,17.5,21/0003/A1016 | ||
18,Aalund,18.5,21/0003/A1017,18,Aalund,18.5,21/0003/A1017 | ||
19,Aaron,19.5,21/0003/A1018,19,Aaron,19.5,21/0003/A1018 | ||
20,Aaronson,20.5,21/0003/A1019,20,Aaronson,20.5,21/0003/A1019 | ||
21,Abadan,21.5,14/0004/A1020,21,Abadan,21.5,14/0004/A1020 | ||
22,"Abailard, Pierre",22.5,sub,22,"Abailard, Pierre",22.5,sub | ||
23,"Abailard, Pierre (Subject)",23.5,14/0004/A1026,23,"Abailard, Pierre (Subject)",23.5,14/0004/A1026 | ||
24,Abailard et Eloise,24.5,14/0004/A1047,24,Abailard et Eloise,24.5,14/0004/A1047 | ||
25,Abandoned,25.5,14/0004/A1022,25,Abandoned,25.5,14/0004/A1022 | ||
26,Abaza,26.5,14/0004/A1027,26,Abaza,26.5,14/0004/A1027 | ||
27,Abb,27.5,14/0004/A1028,27,Abb,27.5,14/0004/A1028 | ||
28,Abbas,28.5,14/0004/A1029,28,Abbas,28.5,14/0004/A1029 | ||
29,Abbasids,29.5,14/0004/A1030,29,Abbasids,29.5,14/0004/A1030 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
|
||
RSpec.describe 'Search Feature', type: :system, js: true do | ||
let(:guide_card_fixture) { Rails.root.join('spec', 'fixtures', 'guide_card_search_fixture.csv') } | ||
before do | ||
GuideCardLoadingService.new(csv_location: guide_card_fixture).import | ||
end | ||
|
||
describe 'search bar on front page' do | ||
it 'returns an index of GuideCards with search term indicated' do | ||
visit '/' | ||
fill_in 'search_term', with: 'Aaron' | ||
click_on 'Go' | ||
expect(page).to have_link('* Aaron') | ||
end | ||
end | ||
end |