intercom 0.1.13 → 0.1.14

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
  SHA1:
3
- metadata.gz: b1cf597e7167e94a21fc5c87f30a68971539d723
4
- data.tar.gz: 2f7292ed806ece40ea6e7f681cd66b3b2b6b15c2
3
+ metadata.gz: 5528d941fb5fce815fc80d08e159e78ed46dc720
4
+ data.tar.gz: af751fee8c6ed9d95b676b7ee081fb83ad351a28
5
5
  SHA512:
6
- metadata.gz: 963e7576902470b933f63a9c5fb330366ef3addc5336155b9f1ad7be627a91dee57317f52b754944a061b504fdfbea3eef4081131570dfc43dde66ee992262c1
7
- data.tar.gz: 9567e21985af78ea96cd4a85ccb7c4028af60125f7e04775bf79de53d857a5136ded318bd409fdb5d2ba4fed5a210585189c56a64974f68240652e723ea484df
6
+ metadata.gz: ecce591469b2667290265c3e36e57173a3a3c690f35264bd29d12bc0fba178cd4b914c2fa9fbcad0daed62c0a023a09a001873007e427dd4aab34bb9bfacc320
7
+ data.tar.gz: f9fdf74c543f538c1191ef7b67b68a0feaf0c8ec7f015302828347361459c5c64d08c4c5548e9fdf81daca72e2604f522b46fe1e1931016316986d72ef806fdf
data/changes.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 0.1.14
2
+ - Update tagging interface for API changes
3
+
1
4
  0.1.13
2
5
  - Add license to gemspec
3
6
 
data/lib/intercom/tag.rb CHANGED
@@ -6,24 +6,22 @@ module Intercom
6
6
  ##
7
7
  # Represents a tag
8
8
  #
9
- # A tag consists of a name, and (optionally) a color and users that you would like to tag. Returns details about the tag and a count of the number of users currently tagged.
9
+ # A tag consists of a name, and (optionally) users that you would like to tag. Returns details about the tag and a count of the number of users currently tagged.
10
10
  #
11
11
  # == Examples
12
12
  #
13
- # tag = Intercom::Tag.create(:name => "Super Tag", :color => "red", :user_ids => ['abc123', 'def456'])
14
- # tag = Intercom::Tag.create(:name => "Super Tag", :color => "red", :emails => ['bob@example.com', 'joe@example.com'])
13
+ # tag = Intercom::Tag.create(:name => "Super Tag", :user_ids => ['abc123', 'def456'])
14
+ # tag = Intercom::Tag.create(:name => "Super Tag", :emails => ['bob@example.com', 'joe@example.com'])
15
15
  #
16
16
  # You can also create a tag and save it like this:
17
17
  # tag = Intercom::Tag.new
18
18
  # tag.name = "Super Tag"
19
- # tag.color = "red"
20
19
  # tag.user_ids = ['abc123', 'def456']
21
20
  # tag.tag_or_untag = "tag"
22
21
  # tag.save
23
22
  #
24
23
  # Or update a tag and save it like this:
25
24
  # tag = Intercom::Tag.find_by_name "Super Tag"
26
- # tag.color = "green"
27
25
  # tag.user_ids = ['abc123']
28
26
  # tag.tag_or_untag = "untag"
29
27
  # tag.save
@@ -32,7 +30,7 @@ module Intercom
32
30
  extend RequiresParameters
33
31
  include HashableObject
34
32
 
35
- attr_accessor :name, :color
33
+ attr_accessor :name
36
34
  attr_reader :segment, :tagged_user_count, :id
37
35
  attr_writer :user_ids, :emails, :tag_or_untag
38
36
 
@@ -1,3 +1,3 @@
1
1
  module Intercom #:nodoc:
2
- VERSION = "0.1.13"
2
+ VERSION = "0.1.14"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -96,17 +96,6 @@ def test_tag
96
96
  {
97
97
  "id" => "4f73428b5e4dfc000b000112",
98
98
  "name" => "Test Tag",
99
- "color" => "red",
100
- "segment" => false,
101
- "tagged_user_count" => 2
102
- }
103
- end
104
-
105
- def updated_test_tag
106
- {
107
- "id" => "4f73428b5e4dfc000b000112",
108
- "name" => "Test Tag",
109
- "color" => "green",
110
99
  "segment" => false,
111
100
  "tagged_user_count" => 2
112
101
  }
@@ -5,38 +5,19 @@ describe "Intercom::Tag" do
5
5
  Intercom.expects(:get).with("/v1/tags", {:name => "Test Tag"}).returns(test_tag)
6
6
  tag = Intercom::Tag.find(:name => "Test Tag")
7
7
  tag.name.must_equal "Test Tag"
8
- tag.color.must_equal "red"
9
- end
10
-
11
- it "gets a tag by name" do
12
- Intercom.expects(:get).with("/v1/tags", {:name => "Test Tag"}).returns(test_tag)
13
- tag = Intercom::Tag.find_by_name "Test Tag"
14
- tag.name.must_equal "Test Tag"
15
- tag.color.must_equal "red"
16
8
  end
17
9
 
18
10
  it "creates a tag" do
19
11
  Intercom.expects(:post).with("/v1/tags", {:name => "Test Tag"}).returns(test_tag)
20
12
  tag = Intercom::Tag.create(:name => "Test Tag")
21
13
  tag.name.must_equal "Test Tag"
22
- tag.color.must_equal "red"
23
14
  end
24
15
 
25
16
  it "tags users" do
26
- Intercom.expects(:post).with("/v1/tags", {:name => "Test Tag", :color => "red", :user_ids => ["abc123", "def456"], :tag_or_untag => "tag"}).returns(test_tag)
27
- tag = Intercom::Tag.create(:name => "Test Tag", :color => "red", :user_ids => ["abc123", "def456"], :tag_or_untag => "tag")
17
+ Intercom.expects(:post).with("/v1/tags", {:name => "Test Tag", :user_ids => ["abc123", "def456"], :tag_or_untag => "tag"}).returns(test_tag)
18
+ tag = Intercom::Tag.create(:name => "Test Tag", :user_ids => ["abc123", "def456"], :tag_or_untag => "tag")
28
19
  tag.name.must_equal "Test Tag"
29
- tag.color.must_equal "red"
30
20
  tag.tagged_user_count.must_equal 2
31
21
  end
32
22
 
33
- it "updates tags" do
34
- Intercom.expects(:get).with("/v1/tags", {:name => "Test Tag"}).returns(test_tag)
35
- tag = Intercom::Tag.find_by_name "Test Tag"
36
- tag.color.must_equal "red"
37
- tag.color = "green"
38
- Intercom.expects(:post).with("/v1/tags", {:name => "Test Tag", :color => "green"}).returns(updated_test_tag)
39
- tag.save
40
- end
41
-
42
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: intercom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben McRedmond