Sha256: c258dd9df88064f8a902ec1c8db94a2b934fddbbae67df9e56028e2d8881d102
Contents?: true
Size: 1.02 KB
Versions: 42
Compression:
Stored size: 1.02 KB
Contents
require 'spec_helper' describe "Intercom::Tag" do let (:client) { Intercom::Client.new(app_id: 'app_id', api_key: 'api_key') } it "creates a tag" do client.expects(:post).with("/tags", {'name' => "Test Tag"}).returns(test_tag) tag = client.tags.create(:name => "Test Tag") tag.name.must_equal "Test Tag" end it "tags users" do client.expects(:post).with("/tags", {'name' => "Test Tag", 'users' => [ { user_id: 'abc123' }, { user_id: 'def456' } ], 'tag_or_untag' => 'tag'}).returns(test_tag) tag = client.tags.tag(:name => "Test Tag", :users => [ { user_id: "abc123" }, { user_id: "def456" } ] ) tag.name.must_equal "Test Tag" tag.tagged_user_count.must_equal 2 end it 'untags users' do client.expects(:post).with("/tags", {'name' => "Test Tag", 'users' => [ { user_id: 'abc123', untag: true }, { user_id: 'def456', untag: true } ], 'tag_or_untag' => 'untag'}).returns(test_tag) client.tags.untag(:name => "Test Tag", :users => [ { user_id: "abc123" }, { user_id: "def456" } ]) end end
Version data entries
42 entries across 42 versions & 1 rubygems