aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-07-01 21:24:47 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-07-01 21:24:47 +0200
commit28399cd9a549cc4edf8c557883c940532821c28d (patch)
tree326cecbb316354e1b4ffdd69eda5af287c0dce9e
parent3de2e771ff7696f55d51befdaf2c38d700b3588c (diff)
downloadoperum-28399cd9a549cc4edf8c557883c940532821c28d.tar.gz
operum-28399cd9a549cc4edf8c557883c940532821c28d.zip
Force english locale for tests
Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
-rw-r--r--config/initializers/locale.rb7
-rw-r--r--test/fixtures/files/all.txt4
-rw-r--r--test/fixtures/files/all.uoc.tex6
-rw-r--r--test/fixtures/files/underscores.uoc.tex6
4 files changed, 14 insertions, 9 deletions
diff --git a/config/initializers/locale.rb b/config/initializers/locale.rb
index f3d7af7..a65accc 100644
--- a/config/initializers/locale.rb
+++ b/config/initializers/locale.rb
@@ -1,6 +1,11 @@
# frozen_string_literal: true
I18n.available_locales = %i[en ca]
-I18n.default_locale = ENV.fetch('OPERUM_DEFAULT_LOCALE', :ca).to_sym
+
+I18n.default_locale = if Rails.env.test?
+ :en
+ else
+ ENV.fetch('OPERUM_DEFAULT_LOCALE', :ca).to_sym
+ end
Rails.logger.info "Locale: #{I18n.default_locale}"
diff --git a/test/fixtures/files/all.txt b/test/fixtures/files/all.txt
index 49205a9..d40d6b3 100644
--- a/test/fixtures/files/all.txt
+++ b/test/fixtures/files/all.txt
@@ -1,2 +1,2 @@
-Sabaté, Miquel; Nom (eds.) (2024). This is a 2. Dins de Some other thing, 22-24. This is a note 2. Publisher 2, Address 2: 2024.
-Sabaté, Miquel; Smith, John; cognom2, Nom cognom1; cognom3 cognom4, Nom (2024). This is a title 1. Dins de Some other thing, 22-24. This is a note 1. Publisher 1.
+Sabaté, Miquel; Nom (eds.) (2024). This is a 2. Inside of Some other thing, 22-24. This is a note 2. Publisher 2, Address 2: 2024.
+Sabaté, Miquel; Smith, John; cognom2, Nom cognom1; cognom3 cognom4, Nom (2024). This is a title 1. Inside of Some other thing, 22-24. This is a note 1. Publisher 1.
diff --git a/test/fixtures/files/all.uoc.tex b/test/fixtures/files/all.uoc.tex
index 227a2bb..a4bacbc 100644
--- a/test/fixtures/files/all.uoc.tex
+++ b/test/fixtures/files/all.uoc.tex
@@ -1,9 +1,9 @@
-\chapter{Bibliografia}
+\chapter{Bibliography}
{\setlength{\parskip}{-0.3cm}
-\hypertarget{target2}{\textsc{Sabaté}, Miquel; \textsc{Nom} (eds.) (2024). \emph{This is a 2}. Dins de \emph{Some other thing}, 22-24. This is a note 2. Publisher 2, Address 2: 2024.}
+\hypertarget{target2}{\textsc{Sabaté}, Miquel; \textsc{Nom} (eds.) (2024). \emph{This is a 2}. Inside of \emph{Some other thing}, 22-24. This is a note 2. Publisher 2, Address 2: 2024.}
-\\~\\\hypertarget{target1}{\textsc{Sabaté}, Miquel; \textsc{Smith}, John; \textsc{cognom2}, Nom cognom1; \textsc{cognom3 cognom4}, Nom (2024). \emph{This is a title 1}. Dins de \emph{Some other thing}, 22-24. This is a note 1. Publisher 1. [\url{http://example.com}]. [Última data de consulta: 24 de febrer de 2024].}
+\\~\\\hypertarget{target1}{\textsc{Sabaté}, Miquel; \textsc{Smith}, John; \textsc{cognom2}, Nom cognom1; \textsc{cognom3 cognom4}, Nom (2024). \emph{This is a title 1}. Inside of \emph{Some other thing}, 22-24. This is a note 1. Publisher 1. [\url{http://example.com}]. [Last consulted at: february 24, 2024].}
}
diff --git a/test/fixtures/files/underscores.uoc.tex b/test/fixtures/files/underscores.uoc.tex
index 0c86890..6189bcd 100644
--- a/test/fixtures/files/underscores.uoc.tex
+++ b/test/fixtures/files/underscores.uoc.tex
@@ -1,9 +1,9 @@
-\chapter{Bibliografia}
+\chapter{Bibliography}
{\setlength{\parskip}{-0.3cm}
-\hypertarget{target2}{\textsc{Sabaté}, Miquel; \textsc{Nom} (eds.) (2024). \emph{This is a 2}. Dins de \emph{Some other thing}, 22-24. This is a note 2. Publisher 2, Address 2: 2024.}
+\hypertarget{target2}{\textsc{Sabaté}, Miquel; \textsc{Nom} (eds.) (2024). \emph{This is a 2}. Inside of \emph{Some other thing}, 22-24. This is a note 2. Publisher 2, Address 2: 2024.}
-\\~\\\hypertarget{target1}{\textsc{Sabaté}, Miquel; \textsc{Smith}, John; \textsc{cognom2}, Nom cognom1; \textsc{cognom3 cognom4}, Nom (2024). \emph{This is a }title\emph{ with }many\emph{ underscores}. Dins de \emph{Some other thing}, 22-24. This is a note 1. Publisher 1. [\url{http://example.com}]. [Última data de consulta: 24 de febrer de 2024].}
+\\~\\\hypertarget{target1}{\textsc{Sabaté}, Miquel; \textsc{Smith}, John; \textsc{cognom2}, Nom cognom1; \textsc{cognom3 cognom4}, Nom (2024). \emph{This is a }title\emph{ with }many\emph{ underscores}. Inside of \emph{Some other thing}, 22-24. This is a note 1. Publisher 1. [\url{http://example.com}]. [Last consulted at: february 24, 2024].}
}