Skip to content

Commit 776728c

Browse files
committed
fix sort title field in specs
1 parent ff6df88 commit 776728c

3 files changed

Lines changed: 18 additions & 12 deletions

File tree

spec/controllers/catalog_controller_spec.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,13 @@
230230
end
231231

232232
let(:expected_sort_fields) do
233-
["score desc", "title_alpha_numeric_ssort asc", "title_alpha_numeric_ssort desc", "date_dtsort desc", "date_dtsort asc"]
233+
[
234+
"score desc",
235+
"exists(sort_title_ssort) asc, sort_title_ssort asc, exists(title_alpha_numeric_ssort) asc, title_alpha_numeric_ssort asc",
236+
"exists(sort_title_ssort) asc, sort_title_ssort desc, exists(title_alpha_numeric_ssort) asc, title_alpha_numeric_ssort desc",
237+
"date_dtsort desc",
238+
"date_dtsort asc",
239+
]
234240
end
235241

236242
it 'has exactly expected sort fields' do

spec/support/works.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
has_model_ssim: ['Work'],
77
title_tesim: ['The Title of my Work'],
88
sort_title_ssort: 'The Title of my Work',
9-
title_alpha_numeric_ssort: 'The Title 1 of my Work',
9+
sort_title_ssort: 'The Title 1 of my Work',
1010
description_tesim: ['Description 1', 'Description 2'],
1111
subject_tesim: ['Subj 1', 'Subj 2'],
1212
human_readable_resource_type_tesim: ['still image'],
@@ -54,7 +54,7 @@
5454
has_model_ssim: ['Work'],
5555
title_tesim: ['Title One'],
5656
sort_title_ssort: 'Title One',
57-
title_alpha_numeric_ssort: 'The Title 2 of my Work',
57+
sort_title_ssort: 'The Title 2 of my Work',
5858
identifier_tesim: ['ark 123'],
5959
description_tesim: ['Description 1', 'Description 2'],
6060
date_created_tesim: ["Date 1"],
@@ -77,7 +77,7 @@
7777
has_model_ssim: ['Work'],
7878
title_tesim: ['Title Two'],
7979
sort_title_ssort: 'Title Two',
80-
title_alpha_numeric_ssort: 'The Title 10 of my Work',
80+
sort_title_ssort: 'The Title 10 of my Work',
8181
identifier_tesim: ['ark 456'],
8282
description_tesim: ['Description 3', 'Description 4'],
8383
date_created_tesim: ["Date 1"],
@@ -112,7 +112,7 @@
112112
has_model_ssim: ['Work'],
113113
title_tesim: ['Title Three'],
114114
sort_title_ssort: 'Title Three',
115-
title_alpha_numeric_ssort: 'The Title 100 of my Work',
115+
sort_title_ssort: 'The Title 100 of my Work',
116116
identifier_tesim: ['ark 456'],
117117
description_tesim: ['Description 3', 'Description 4', 'another desc'],
118118
date_created_tesim: ["Date 1"],
@@ -133,7 +133,7 @@
133133
has_model_ssim: ['Work'],
134134
title_tesim: ['Title Three'],
135135
sort_title_ssort: 'Title Three',
136-
title_alpha_numeric_ssort: 'The Title 100 of my Work',
136+
sort_title_ssort: 'The Title 100 of my Work',
137137
identifier_tesim: ['ark 456'],
138138
description_tesim: ['Description 3', 'Description 4', 'another desc'],
139139
date_created_tesim: ["Date 1"],
@@ -154,7 +154,7 @@
154154
has_model_ssim: ['Work'],
155155
title_tesim: ['Title Three'],
156156
sort_title_ssort: 'Title Three',
157-
title_alpha_numeric_ssort: 'The Title 100 of my Work',
157+
sort_title_ssort: 'The Title 100 of my Work',
158158
identifier_tesim: ['ark 456'],
159159
description_tesim: ['Description 3', 'Description 4', 'another desc'],
160160
date_created_tesim: ["Date 1"],
@@ -175,7 +175,7 @@
175175
has_model_ssim: ['Work'],
176176
title_tesim: ['Title Three'],
177177
sort_title_ssort: 'Title Three',
178-
title_alpha_numeric_ssort: 'The Title 100 of my Work',
178+
sort_title_ssort: 'The Title 100 of my Work',
179179
identifier_tesim: ['ark 456'],
180180
description_tesim: ['Description 3', 'Description 4', 'another desc'],
181181
date_created_tesim: ["Date 1"],
@@ -196,7 +196,7 @@
196196
has_model_ssim: ['Work'],
197197
title_tesim: ['Title Three'],
198198
sort_title_ssort: 'Title Three',
199-
title_alpha_numeric_ssort: 'The Title 100 of my Work',
199+
sort_title_ssort: 'The Title 100 of my Work',
200200
identifier_tesim: ['ark 456'],
201201
description_tesim: ['Description 3', 'Description 4', 'another desc'],
202202
date_created_tesim: ["Date 1"],
@@ -217,7 +217,7 @@
217217
has_model_ssim: ['Work'],
218218
title_tesim: ['Title Three'],
219219
sort_title_ssort: 'Title Three',
220-
title_alpha_numeric_ssort: 'The Title 100 of my Work',
220+
sort_title_ssort: 'The Title 100 of my Work',
221221
identifier_tesim: ['ark 456'],
222222
description_tesim: ['Description 3', 'Description 4', 'another desc'],
223223
date_created_tesim: ["Date 1"],

spec/system/search_results_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@
9696
end
9797

9898
it 'has correct sorting behavior for title' do
99-
visit '/catalog?q=&search_field=all_fields&sort=title_alpha_numeric_ssort+asc' do
99+
visit '/catalog?q=&search_field=all_fields&sort=sort_title_ssort+asc' do
100100
expect(page).to have_content('1. Title One')
101101
end
102102

103-
visit '/catalog?q=&search_field=all_fields&sort=title_alpha_numeric_ssort+desc' do
103+
visit '/catalog?q=&search_field=all_fields&sort=sort_title_ssort+desc' do
104104
expect(page).to have_content('1. Title Two')
105105
end
106106
end

0 commit comments

Comments
 (0)