Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test against subdirectory environment #32

Open
hanachin opened this issue Feb 6, 2020 · 0 comments
Open

Test against subdirectory environment #32

hanachin opened this issue Feb 6, 2020 · 0 comments

Comments

@hanachin
Copy link
Contributor

@hanachin hanachin commented Feb 6, 2020

Redmine may run in a subdirectory environment.
https://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_subdirectory_(sub-URI)_on_Apache

I sometimes write bugs that only occur in a subdirectory environment.
For example, sending a request to / using JavaScript.

So I want to run my feature spec(or system test) against subdirectory environment.

TODO

  • Add apply-patch-subdirectory command to apply the following patch.
diff --git a/config.ru b/config.ru
index 5bc2a619e..e30b85ece 100644
--- a/config.ru
+++ b/config.ru
@@ -1,4 +1,7 @@
 # This file is used by Rack-based servers to start the application.
 
 require ::File.expand_path('../config/environment',  __FILE__)
-run Rails.application
+
+map '/redmine' do
+  run Rails.application
+end
diff --git a/config/initializers/relative_url_root.rb b/config/initializers/relative_url_root.rb
new file mode 100644
index 000000000..6438db43e
--- /dev/null
+++ b/config/initializers/relative_url_root.rb
@@ -0,0 +1 @@
+Redmine::Utils::relative_url_root = "/redmine"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.