Sha256: e1129e9b4db85043eab3383ab3ad51c07621253fcb237b2ac8251771c9c87916

Contents?: true

Size: 814 Bytes

Versions: 11

Compression:

Stored size: 814 Bytes

Contents

require 'spec_helper'

describe "Intercom::Tag" do
  it "gets a tag" do
    Intercom.expects(:get).with("/v1/tags", {:name => "Test Tag"}).returns(test_tag)
    tag = Intercom::Tag.find(:name => "Test Tag")
    tag.name.must_equal "Test Tag"
  end

  it "creates a tag" do
    Intercom.expects(:post).with("/v1/tags", {:name => "Test Tag"}).returns(test_tag)
    tag = Intercom::Tag.create(:name => "Test Tag")
    tag.name.must_equal "Test Tag"
  end

  it "tags users" do
    Intercom.expects(:post).with("/v1/tags", {:name => "Test Tag", :user_ids => ["abc123", "def456"], :tag_or_untag => "tag"}).returns(test_tag)
    tag = Intercom::Tag.create(:name => "Test Tag", :user_ids => ["abc123", "def456"], :tag_or_untag => "tag")
    tag.name.must_equal "Test Tag"
    tag.tagged_user_count.must_equal 2
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
intercom-1.0.0 spec/unit/intercom/tag_spec.rb
intercom-0.3.0 spec/unit/intercom/tag_spec.rb
intercom-0.2.3 spec/unit/intercom/tag_spec.rb
intercom-0.2.2 spec/unit/intercom/tag_spec.rb
intercom-0.2.1 spec/unit/intercom/tag_spec.rb
intercom-0.2.0 spec/unit/intercom/tag_spec.rb
intercom-0.1.19 spec/unit/intercom/tag_spec.rb
intercom-0.1.17 spec/unit/intercom/tag_spec.rb
intercom-0.1.16 spec/unit/intercom/tag_spec.rb
intercom-0.1.15 spec/unit/intercom/tag_spec.rb
intercom-0.1.14 spec/unit/intercom/tag_spec.rb