Project

General

Profile

Defect #30455 » 30455-fix.diff

Go MAEDA, 2019-01-17 12:49

View differences:

app/models/mail_handler.rb (working copy)
237 237
    end
238 238

  
239 239
    # ignore CLI-supplied defaults for new issues
240
    handler_options[:issue].clear
240
    handler_options[:issue] = {}
241 241

  
242 242
    journal = issue.init_journal(user)
243 243
    if from_journal && from_journal.private_notes?
test/functional/mail_handler_controller_test.rb (working copy)
60 60
    assert_equal true, issue.is_private
61 61
  end
62 62

  
63
  def test_should_update_issue
64
    # Enable API and set a key
65
    Setting.mail_handler_api_enabled = 1
66
    Setting.mail_handler_api_key = 'secret'
67

  
68
    assert_difference 'Journal.count' do
69
      post :index, :params => {
70
          :key => 'secret',
71
          :email => IO.read(File.join(FIXTURES_PATH, 'ticket_reply.eml'))
72
        }
73
    end
74
    assert_response 201
75
  end
76

  
63 77
  def test_should_respond_with_422_if_not_created
64 78
    Project.find('onlinestore').destroy
65 79

  
(1-1/2)