spec/features/exhibits/translation_editing_spec.rb in blacklight-spotlight-2.0.2 vs spec/features/exhibits/translation_editing_spec.rb in blacklight-spotlight-2.1.0

- old
+ new

@@ -6,10 +6,11 @@ before do FactoryBot.create(:language, exhibit: exhibit, locale: 'sq') FactoryBot.create(:language, exhibit: exhibit, locale: 'fr') login_as admin end + describe 'general' do before do visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr') end @@ -37,10 +38,11 @@ within '.translation-basic-settings-description' do expect(page).to_not have_css 'span.glyphicon.glyphicon-ok' end end end + describe 'main menu' do it 'adds translations to exhibit navbar' do within '.translation-edit-form #general' do expect(page).to have_css '.help-block', text: 'Home' fill_in 'Home', with: 'Maison' @@ -74,10 +76,11 @@ fill_in 'Home', with: 'Maison' fill_in 'Browse', with: 'parcourir ceci!' click_button 'Save changes' end end + it 'adds translations to user-facing breadcrumbs' do expect(page).to have_css '.flash_messages', text: 'The exhibit was successfully updated.' visit spotlight.exhibit_browse_index_path(exhibit, locale: 'fr') expect(page).to have_breadcrumbs 'Maison', 'parcourir ceci!' end @@ -120,10 +123,11 @@ fill_in 'Home', with: 'Maison' fill_in 'About', with: 'Sur' click_button 'Save changes' end end + it 'adds breadcrumbs to pages' do visit spotlight.exhibit_about_page_path(about_page2.exhibit, about_page2, locale: 'fr') expect(page).to have_breadcrumbs 'Maison', 'Sur', about_page2.title end @@ -139,10 +143,11 @@ fill_in 'Home', with: 'Maison' fill_in 'Search Results', with: 'Résultats de la recherche' click_button 'Save changes' end end + it 'adds breadcrumbs user facing catalog' do visit spotlight.search_exhibit_catalog_path(exhibit, q: '*', locale: 'fr') expect(page).to have_breadcrumbs 'Maison', 'Résultats de la recherche' end @@ -385,9 +390,10 @@ describe 'translation progress counter', js: true do before do FactoryBot.create(:translation, exhibit: exhibit, locale: 'fr', key: "#{exhibit.slug}.title", value: 'Titre') end + it 'counts existing and total available translations' do visit spotlight.edit_exhibit_translations_path(exhibit, language: 'fr') expect(page).to have_link('General 1/8') expect(page).to have_link('Search field labels 0/16') expect(page).to have_link('Browse categories 0/2')