Sha256: 39f5af284fc366d4652dcdfb3b6b867d4758d0261737e1d90b36c35b2ad7b033

Contents?: true

Size: 809 Bytes

Versions: 24

Compression:

Stored size: 809 Bytes

Contents

require 'spec_helper'

describe "Intercom::Tag" do
  it "gets a tag" do
    Intercom.expects(:get).with("/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("/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("/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

24 entries across 24 versions & 2 rubygems

Version Path
intercom-2.0.3 spec/unit/intercom/tag_spec.rb
intercom-2.0.2 spec/unit/intercom/tag_spec.rb
intercom-2.0.1 spec/unit/intercom/tag_spec.rb
intercom-2.0.0 spec/unit/intercom/tag_spec.rb