Sha256: b642cc1d544f6beb9a48fad54aa6d4c0a637c3c9e3cd31b44189f313cba4d94d
Contents?: true
Size: 819 Bytes
Versions: 24
Compression:
Stored size: 819 Bytes
Contents
require "spec_helper" describe "/v1/impressions" do it "creates a good impression" do Intercom.expects(:post).with("/v1/users/impressions", {"email" => "jo@example.com", "location" => "/some/path/in/my/app"}).returns({"unread_messages" => 10}) impression = Intercom::Impression.create("email" => "jo@example.com", "location" => "/some/path/in/my/app") impression.unread_messages.must_equal 10 end it "sets/gets allowed keys" do params = {"user_ip" => "1.2.3.4", "user_agent" => "ie6", "location" => "/some/path/in/my/app", "email" => "me@example.com", :user_id => "abc123"} impression = Intercom::Impression.new(params) impression.to_hash.keys.sort.must_equal params.keys.map(&:to_s).sort params.keys.each do | key| impression.send(key).must_equal params[key] end end end
Version data entries
24 entries across 24 versions & 1 rubygems