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
+ post :lost_password, :mail => 'JSmith@somenet.foo'
+ assert_redirected_to '/login'
end
end
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
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' },
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