1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

No need to use custom host name in these tests.

git-svn-id: http://svn.redmine.org/redmine/trunk@15285 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2016-03-26 09:58:06 +00:00
parent fe22c77b59
commit 56ba4d0209
2 changed files with 5 additions and 7 deletions

View File

@ -326,19 +326,17 @@ class AccountControllerTest < ActionController::TestCase
ActionMailer::Base.deliveries.clear
assert_difference 'ActionMailer::Base.deliveries.size' do
assert_difference 'Token.count' do
with_settings :host_name => 'mydomain.foo', :protocol => 'http' do
post :lost_password, :mail => 'JSmith@somenet.foo'
assert_redirected_to '/login'
end
end
end
token = Token.order('id DESC').first
assert_equal User.find(2), token.user
assert_equal 'recovery', token.action
assert_select_email do
assert_select "a[href=?]", "http://mydomain.foo/account/lost_password?token=#{token.value}"
assert_select "a[href=?]", "http://localhost:3000/account/lost_password?token=#{token.value}"
end
end

View File

@ -2587,7 +2587,7 @@ class IssuesControllerTest < ActionController::TestCase
set_tmp_attachments_directory
@request.session[:user_id] = 2
with_settings :host_name => 'mydomain.foo', :protocol => 'http', :notified_events => %w(issue_added) do
with_settings :notified_events => %w(issue_added) do
assert_difference 'Issue.count' do
post :create, :project_id => 1,
:issue => { :tracker_id => '1', :subject => 'With attachment' },
@ -2597,7 +2597,7 @@ class IssuesControllerTest < ActionController::TestCase
assert_not_nil ActionMailer::Base.deliveries.last
assert_select_email do
assert_select 'a[href^=?]', 'http://mydomain.foo/attachments/download', 'testfile.txt'
assert_select 'a[href^=?]', 'http://localhost:3000/attachments/download', 'testfile.txt'
end
end