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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a08597c1b35076c3e6b00e4f519d6736a15d4a1a381655cebc2f48b08e3000c2
4
- data.tar.gz: 2903569370a64fbfbab7c9a0da76f995eaabc3313ec497a4651d5004c4be481a
3
+ metadata.gz: 7fd2a029a6612a185a1acfe4e9043e049ec23ea3229f12ddfe9cb367b96eab6e
4
+ data.tar.gz: c49087935482f104f4cf7583913a7f48f25e390c75ce7abfc9623955a1591b81
5
5
  SHA512:
6
- metadata.gz: 6b7bb26a5fe32a13230f21cdae687671ee9fbdf87bb3e045628bc7b256be7ad42760522ef0b171272b6bde6a8ae20e0d58f5f685bfe6ae39c341af9999b8011e
7
- data.tar.gz: 5e17d09e8fefc432348ce41ab5b002971a5b00bd711ddd0c5e28ea9e59fc35d6d065ae6695feee4541732e3212fc2b96c39da6ac6deb8dd369eac57035682c46
6
+ metadata.gz: 10b2090a71a1d19aaa099057cc76655bfbdc98165356397bb2c606132178e371194c5c7e52f70905928aa7988e49b1af214a93c81ccfe9e2b0c504a73a324a0f
7
+ data.tar.gz: 95a423be06e499ae47ee23fd691b8be75c7c1edfffbc77fc77d4c28b5f7ed5763cee24beb010f3195bda9253672ab5154e860f24ea5293591bebb3473ad77f15
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-asana (0.0.2)
4
+ danger-asana (0.0.3)
5
5
  asana (~> 0.10)
6
6
  danger-plugin-api (~> 1.0)
7
7
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Asana
4
- VERSION = "0.0.2"
4
+ VERSION = "0.0.3"
5
5
  end
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
- messages << "**[#{task.name}](#{task.permalink_url})**\n#{task.notes} |"
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 receive_message_chain("find_by_id.name").and_return("task 1", "task 2")
22
- allow(@asana).to receive_message_chain("find_by_id.notes").and_return("description 1", "description 2")
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 receive_message_chain("find_by_id.name").and_return("task 1", "task 2")
40
- allow(@asana).to receive_message_chain("find_by_id.notes").and_return("description 1", "description 2")
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 receive_message_chain("find_by_id.name").and_return("task 1")
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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-asana
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Joulin