danger-asana 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/asana/gem_version.rb +1 -1
- data/lib/asana/plugin.rb +4 -1
- data/spec/asana_spec.rb +17 -9
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7fd2a029a6612a185a1acfe4e9043e049ec23ea3229f12ddfe9cb367b96eab6e
|
4
|
+
data.tar.gz: c49087935482f104f4cf7583913a7f48f25e390c75ce7abfc9623955a1591b81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10b2090a71a1d19aaa099057cc76655bfbdc98165356397bb2c606132178e371194c5c7e52f70905928aa7988e49b1af214a93c81ccfe9e2b0c504a73a324a0f
|
7
|
+
data.tar.gz: 95a423be06e499ae47ee23fd691b8be75c7c1edfffbc77fc77d4c28b5f7ed5763cee24beb010f3195bda9253672ab5154e860f24ea5293591bebb3473ad77f15
|
data/Gemfile.lock
CHANGED
data/lib/asana/gem_version.rb
CHANGED
data/lib/asana/plugin.rb
CHANGED
@@ -34,7 +34,10 @@ module Danger
|
|
34
34
|
task = find_by_id(issue)
|
35
35
|
|
36
36
|
unless task.nil?
|
37
|
-
|
37
|
+
name = task.name[0..300].gsub("\n", "<br />").strip
|
38
|
+
notes = task.notes[0..300].gsub("\n", "<br />").strip
|
39
|
+
|
40
|
+
messages << "**[#{name}](#{task.permalink_url})**\n#{notes} |"
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
data/spec/asana_spec.rb
CHANGED
@@ -12,15 +12,26 @@ module Danger
|
|
12
12
|
before do
|
13
13
|
@dangerfile = testing_dangerfile
|
14
14
|
@asana = @dangerfile.asana
|
15
|
+
|
16
|
+
@task1 = double("Task 1", {
|
17
|
+
name: "task 1",
|
18
|
+
notes: "description 1",
|
19
|
+
permalink_url: "https://app.asana.com/0/1"
|
20
|
+
})
|
21
|
+
|
22
|
+
@task2 = double("Task 2", {
|
23
|
+
name: "task 2",
|
24
|
+
notes: "description 2",
|
25
|
+
permalink_url: "https://app.asana.com/0/2"
|
26
|
+
})
|
15
27
|
end
|
16
28
|
|
17
29
|
it "Finds multiple Asana tasks ids in body and title" do
|
18
30
|
allow(@asana).to receive_message_chain("github.pr_title").and_return("[#1200084894659941] Test PR")
|
19
31
|
allow(@asana).to receive_message_chain("github.pr_body").and_return("[#1200084894659949]")
|
20
32
|
|
21
|
-
allow(@asana).to
|
22
|
-
allow(@asana).to
|
23
|
-
allow(@asana).to receive_message_chain("find_by_id.permalink_url").and_return("https://app.asana.com/0/1", "https://app.asana.com/0/2")
|
33
|
+
allow(@asana).to receive("find_by_id").with("1200084894659941").and_return(@task1)
|
34
|
+
allow(@asana).to receive("find_by_id").with("1200084894659949").and_return(@task2)
|
24
35
|
|
25
36
|
@asana.check
|
26
37
|
|
@@ -36,9 +47,8 @@ description 2 |))
|
|
36
47
|
allow(@asana).to receive_message_chain("github.pr_title").and_return("Test PR")
|
37
48
|
allow(@asana).to receive_message_chain("github.pr_body").and_return("testing\n\nhttps://app.asana.com/0/1199918955119300/1200084193308092]\nhttps://app.asana.com/0/1199972814069143/1199619253751287")
|
38
49
|
|
39
|
-
allow(@asana).to
|
40
|
-
allow(@asana).to
|
41
|
-
allow(@asana).to receive_message_chain("find_by_id.permalink_url").and_return("https://app.asana.com/0/1", "https://app.asana.com/0/2")
|
50
|
+
allow(@asana).to receive("find_by_id").with("1200084193308092").and_return(@task1)
|
51
|
+
allow(@asana).to receive("find_by_id").with("1199619253751287").and_return(@task2)
|
42
52
|
|
43
53
|
@asana.check
|
44
54
|
|
@@ -54,9 +64,7 @@ description 2 |))
|
|
54
64
|
allow(@asana).to receive_message_chain("github.pr_title").and_return("[#1200084894659941]")
|
55
65
|
allow(@asana).to receive_message_chain("github.pr_body").and_return("https://app.asana.com/0/1199972814069143/1200084894659941")
|
56
66
|
|
57
|
-
allow(@asana).to
|
58
|
-
allow(@asana).to receive_message_chain("find_by_id.notes").and_return("description 1")
|
59
|
-
allow(@asana).to receive_message_chain("find_by_id.permalink_url").and_return("https://app.asana.com/0/1")
|
67
|
+
allow(@asana).to receive("find_by_id").with("1200084894659941").and_return(@task1)
|
60
68
|
|
61
69
|
@asana.check
|
62
70
|
|