lazylead 0.7.2 → 0.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/.docs/duedate_expired.md +1 -1
  3. data/.rubocop.yml +18 -3
  4. data/Gemfile +1 -1
  5. data/Guardfile +1 -1
  6. data/Rakefile +1 -1
  7. data/bin/lazylead +1 -1
  8. data/lazylead.gemspec +11 -11
  9. data/lib/lazylead.rb +2 -2
  10. data/lib/lazylead/allocated.rb +1 -1
  11. data/lib/lazylead/cc.rb +1 -1
  12. data/lib/lazylead/cli/app.rb +1 -1
  13. data/lib/lazylead/confluence.rb +1 -1
  14. data/lib/lazylead/email.rb +1 -1
  15. data/lib/lazylead/exchange.rb +1 -1
  16. data/lib/lazylead/home.rb +1 -1
  17. data/lib/lazylead/log.rb +1 -1
  18. data/lib/lazylead/model.rb +1 -1
  19. data/lib/lazylead/opts.rb +6 -3
  20. data/lib/lazylead/postman.rb +1 -1
  21. data/lib/lazylead/requires.rb +38 -0
  22. data/lib/lazylead/salt.rb +1 -1
  23. data/lib/lazylead/schedule.rb +1 -1
  24. data/lib/lazylead/smtp.rb +1 -1
  25. data/lib/lazylead/system/empty.rb +1 -1
  26. data/lib/lazylead/system/fake.rb +1 -1
  27. data/lib/lazylead/system/jira.rb +19 -18
  28. data/lib/lazylead/system/synced.rb +1 -1
  29. data/lib/lazylead/task/accuracy/accuracy.rb +15 -18
  30. data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
  31. data/lib/lazylead/task/accuracy/attachment.rb +1 -1
  32. data/lib/lazylead/task/accuracy/environment.rb +1 -1
  33. data/lib/lazylead/task/accuracy/logs.rb +1 -1
  34. data/lib/lazylead/task/accuracy/onlyll.rb +1 -1
  35. data/lib/lazylead/task/accuracy/records.rb +1 -1
  36. data/lib/lazylead/task/accuracy/requirement.rb +1 -1
  37. data/lib/lazylead/task/accuracy/servers.rb +1 -1
  38. data/lib/lazylead/task/accuracy/stacktrace.rb +1 -1
  39. data/lib/lazylead/task/accuracy/testcase.rb +1 -1
  40. data/lib/lazylead/task/accuracy/wiki.rb +1 -1
  41. data/lib/lazylead/task/{alert.rb → alert/alert.rb} +6 -6
  42. data/lib/lazylead/task/alert/alertif.rb +75 -0
  43. data/lib/lazylead/task/alert/changed_to.rb +58 -0
  44. data/lib/lazylead/task/assignment.rb +1 -1
  45. data/lib/lazylead/task/confluence_ref.rb +1 -1
  46. data/lib/lazylead/task/echo.rb +1 -1
  47. data/lib/lazylead/task/fix_version.rb +1 -1
  48. data/lib/lazylead/task/loading.rb +94 -0
  49. data/lib/lazylead/task/missing_comment.rb +1 -1
  50. data/lib/lazylead/task/propagate_down.rb +3 -3
  51. data/lib/lazylead/task/savepoint.rb +1 -1
  52. data/lib/lazylead/task/svn/diff.rb +1 -1
  53. data/lib/lazylead/task/svn/grep.rb +1 -1
  54. data/lib/lazylead/task/svn/touch.rb +1 -1
  55. data/lib/lazylead/version.rb +2 -2
  56. data/lib/messages/accuracy.erb +1 -1
  57. data/lib/messages/alertif.erb +134 -0
  58. data/lib/messages/created_recently.erb +110 -0
  59. data/lib/messages/loading.erb +117 -0
  60. data/readme.md +3 -3
  61. data/test/lazylead/allocated_test.rb +1 -1
  62. data/test/lazylead/cc_test.rb +1 -1
  63. data/test/lazylead/cli/app_test.rb +2 -2
  64. data/test/lazylead/confluence_test.rb +1 -1
  65. data/test/lazylead/exchange_test.rb +1 -1
  66. data/test/lazylead/model_test.rb +1 -1
  67. data/test/lazylead/opts_test.rb +1 -1
  68. data/test/lazylead/postman_test.rb +1 -1
  69. data/test/lazylead/salt_test.rb +1 -1
  70. data/test/lazylead/smoke_test.rb +1 -1
  71. data/test/lazylead/smtp_test.rb +1 -1
  72. data/test/lazylead/system/jira_test.rb +10 -1
  73. data/test/lazylead/task/accuracy/accuracy_test.rb +1 -1
  74. data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
  75. data/test/lazylead/task/accuracy/attachment_test.rb +1 -1
  76. data/test/lazylead/task/accuracy/environment_test.rb +1 -1
  77. data/test/lazylead/task/accuracy/logs_test.rb +1 -1
  78. data/test/lazylead/task/accuracy/onlyll_test.rb +1 -1
  79. data/test/lazylead/task/accuracy/records_test.rb +1 -1
  80. data/test/lazylead/task/accuracy/score_test.rb +2 -2
  81. data/test/lazylead/task/accuracy/servers_test.rb +1 -1
  82. data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
  83. data/test/lazylead/task/accuracy/testcase_test.rb +1 -1
  84. data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
  85. data/test/lazylead/task/alert/alertif_test.rb +54 -0
  86. data/test/lazylead/task/{assignee_alert_test.rb → alert/assignee_alert_test.rb} +10 -10
  87. data/test/lazylead/task/alert/changed_to_test.rb +42 -0
  88. data/test/lazylead/task/assignment_test.rb +1 -1
  89. data/test/lazylead/task/confluence_ref_test.rb +1 -1
  90. data/test/lazylead/task/created_recently_test.rb +53 -0
  91. data/test/lazylead/task/duedate_test.rb +2 -2
  92. data/test/lazylead/task/echo_test.rb +1 -1
  93. data/test/lazylead/task/fix_version_test.rb +1 -1
  94. data/test/lazylead/task/loading_test.rb +54 -0
  95. data/test/lazylead/task/missing_comment_test.rb +1 -1
  96. data/test/lazylead/task/propagate_down_test.rb +1 -1
  97. data/test/lazylead/task/savepoint_test.rb +1 -1
  98. data/test/lazylead/task/svn/diff_test.rb +1 -1
  99. data/test/lazylead/task/svn/grep_test.rb +1 -1
  100. data/test/lazylead/task/svn/touch_test.rb +1 -1
  101. data/test/lazylead/version_test.rb +1 -1
  102. data/test/sqlite_test.rb +1 -1
  103. data/test/test.rb +1 -1
  104. data/upgrades/sqlite/001-install-main-lazylead-tables.sql +1 -1
  105. data/upgrades/sqlite/999.testdata.sql +1 -1
  106. metadata +37 -22
data/readme.md CHANGED
@@ -32,9 +32,9 @@ Join our telegram group [lazylead.org](https://t.me/lazyleads) for discussions.
32
32
 
33
33
  | Daily annoying task | Jira | Github | Trello |
34
34
  | :---------------------------------------------------------------------------------- | :---: | :----: | :----: |
35
- | [Notify ticket's assignee](lib/lazylead/task/alert.rb) | ✅ | ⌛ | ⌛ |
36
- | [Notify ticket's reporter](lib/lazylead/task/alert.rb) | ✅ | ⌛ | ⌛ |
37
- | [Notify ticket's manager](lib/lazylead/task/alert.rb) | ✅ | ⌛ | ⌛ |
35
+ | [Notify ticket's assignee](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ |
36
+ | [Notify ticket's reporter](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ |
37
+ | [Notify ticket's manager](lib/lazylead/task/alert/alert.rb) | ✅ | ⌛ | ⌛ |
38
38
  | [Notify about illegal "Fix Version" modification](lib/lazylead/task/fix_version.rb) | ✅ | ❌ | ❌ |
39
39
  | [Expected comment in ticket is missing](lib/lazylead/task/missing_comment.rb) | ✅ | ⌛ | ⌛ |
40
40
  | [Propagate some fields from parent ticket into sub-tasks](.docs/propagate_down.md) | ✅ | ❌ | ❌ |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,10 +2,10 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
- # of this software and associated documentation files (the "Software"],
8
+ # of this software and associated documentation files (the "Software"),
9
9
  # to deal in the Software without restriction, including without limitation
10
10
  # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
11
  # and/or sell copies of the Software, and to permit persons to whom
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -185,5 +185,14 @@ module Lazylead
185
185
  .issues("key>DATAJDBC-500")
186
186
  .size >= 118
187
187
  end
188
+
189
+ test "connected based on string properties" do
190
+ refute_empty Jira.new(
191
+ "username" => nil,
192
+ "password" => nil,
193
+ "site" => "https://jira.spring.io",
194
+ "context_path" => ""
195
+ ).issues("key=DATAJDBC-480")
196
+ end
188
197
  end
189
198
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -39,7 +39,7 @@ module Lazylead
39
39
  "100": "100"
40
40
  }.each do |k, v|
41
41
  assert_equal v.to_f,
42
- Lazylead::Score.new({}, {}, {}).grade(k.to_s.to_f)
42
+ Lazylead::Score.new({}, {}).grade(k.to_s.to_f)
43
43
  end
44
44
  end
45
45
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -0,0 +1,54 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"),
9
+ # to deal in the Software without restriction, including without limitation
10
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
+ # and/or sell copies of the Software, and to permit persons to whom
12
+ # the Software is furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included
15
+ # in all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22
+ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
23
+ # OR OTHER DEALINGS IN THE SOFTWARE.
24
+
25
+ require_relative "../../../test"
26
+ require_relative "../../../../lib/lazylead/log"
27
+ require_relative "../../../../lib/lazylead/opts"
28
+ require_relative "../../../../lib/lazylead/smtp"
29
+ require_relative "../../../../lib/lazylead/postman"
30
+ require_relative "../../../../lib/lazylead/system/jira"
31
+ require_relative "../../../../lib/lazylead/task/alert/alertif"
32
+ require_relative "../../../../lib/lazylead/task/alert/changed_to"
33
+
34
+ module Lazylead
35
+ class AlertIfTest < Lazylead::Test
36
+ test "last change to Done" do
37
+ Smtp.new.enable
38
+ Lazylead::Task::AlertIf.new.run(
39
+ NoAuthJira.new("https://jira.spring.io"),
40
+ Postman.new,
41
+ Opts.new(
42
+ "to_status" => "Done",
43
+ "to" => "lead@company.com",
44
+ "from" => "ll@company.com",
45
+ "rules" => "Lazylead::ToStatus",
46
+ "jql" => "key=XD-3064",
47
+ "subject" => "[LL] alert if",
48
+ "template" => "lib/messages/alertif.erb"
49
+ )
50
+ )
51
+ assert_email "[LL] alert if", %w[XD-3064 Critical Done Glenn Risberg HdfsMongoDB]
52
+ end
53
+ end
54
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -22,15 +22,15 @@
22
22
  # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
23
23
  # OR OTHER DEALINGS IN THE SOFTWARE.
24
24
 
25
- require_relative "../../test"
26
- require_relative "../../../lib/lazylead/log"
27
- require_relative "../../../lib/lazylead/smtp"
28
- require_relative "../../../lib/lazylead/postman"
29
- require_relative "../../../lib/lazylead/schedule"
30
- require_relative "../../../lib/lazylead/model"
31
- require_relative "../../../lib/lazylead/cli/app"
32
- require_relative "../../../lib/lazylead/system/jira"
33
- require_relative "../../../lib/lazylead/task/alert"
25
+ require_relative "../../../test"
26
+ require_relative "../../../../lib/lazylead/log"
27
+ require_relative "../../../../lib/lazylead/smtp"
28
+ require_relative "../../../../lib/lazylead/postman"
29
+ require_relative "../../../../lib/lazylead/schedule"
30
+ require_relative "../../../../lib/lazylead/model"
31
+ require_relative "../../../../lib/lazylead/cli/app"
32
+ require_relative "../../../../lib/lazylead/system/jira"
33
+ require_relative "../../../../lib/lazylead/task/alert/alert"
34
34
 
35
35
  module Lazylead
36
36
  class AssigneeAlertTest < Lazylead::Test
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"),
9
+ # to deal in the Software without restriction, including without limitation
10
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
+ # and/or sell copies of the Software, and to permit persons to whom
12
+ # the Software is furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included
15
+ # in all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22
+ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
23
+ # OR OTHER DEALINGS IN THE SOFTWARE.
24
+
25
+ require_relative "../../../test"
26
+ require_relative "../../../../lib/lazylead/log"
27
+ require_relative "../../../../lib/lazylead/opts"
28
+ require_relative "../../../../lib/lazylead/system/jira"
29
+ require_relative "../../../../lib/lazylead/task/alert/changed_to"
30
+
31
+ module Lazylead
32
+ class ToStatusTest < Lazylead::Test
33
+ test "last change to Done" do
34
+ assert Lazylead::ToStatus.new.passed(
35
+ NoAuthJira.new("https://jira.spring.io")
36
+ .issues("key=XD-3064", Opts.new.jira_defaults.merge(expand: "changelog"))
37
+ .first,
38
+ Opts.new("to_status" => "Done")
39
+ )
40
+ end
41
+ end
42
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2020 Yurii Dubinka
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2021 Yurii Dubinka
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"),
9
+ # to deal in the Software without restriction, including without limitation
10
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
+ # and/or sell copies of the Software, and to permit persons to whom
12
+ # the Software is furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included
15
+ # in all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22
+ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
23
+ # OR OTHER DEALINGS IN THE SOFTWARE.
24
+
25
+ require_relative "../../test"
26
+ require_relative "../../../lib/lazylead/log"
27
+ require_relative "../../../lib/lazylead/smtp"
28
+ require_relative "../../../lib/lazylead/postman"
29
+ require_relative "../../../lib/lazylead/schedule"
30
+ require_relative "../../../lib/lazylead/model"
31
+ require_relative "../../../lib/lazylead/cli/app"
32
+ require_relative "../../../lib/lazylead/system/jira"
33
+ require_relative "../../../lib/lazylead/task/alert/alert"
34
+
35
+ module Lazylead
36
+ class CreatedRecentlyTest < Lazylead::Test
37
+ test "issues were fetched" do
38
+ Smtp.new.enable
39
+ Task::Alert.new.run(
40
+ NoAuthJira.new("https://jira.spring.io"),
41
+ Postman.new,
42
+ Opts.new(
43
+ "from" => "fake@email.com",
44
+ "to" => "my@team.com",
45
+ "sql" => "labels=xd and key in (XD-3766, SGF-726)",
46
+ "subject" => "[CR] 20min ago!",
47
+ "template" => "lib/messages/created_recently.erb"
48
+ )
49
+ )
50
+ assert_email "[CR] 20min ago!", %w[XD-3766 SGF-726]
51
+ end
52
+ end
53
+ end