Sha256: 487ef15803e0a830fbf4548096b1bf1061c005ec023c8663ee924d64f33c4207
Contents?: true
Size: 1.15 KB
Versions: 1
Compression:
Stored size: 1.15 KB
Contents
require 'helper' describe FullContact::Client do FullContact::Configuration::VALID_FORMATS.each do |format| context ".new(:format => '#{format}')" do before do @client = FullContact::Client.new(:format => format, :api_key => 'api_key') end end end context "when parsing a response" do before do FullContact.configure do |config| config.api_key = "api_key" end stub_get("person.json"). with(:query => {:apiKey => "api_key", :email => "brawest@gmail.com"}). to_return(:body => fixture("person.json"), :headers => {:content_type => "application/json; charset=utf-8"}) stub_get("person.json"). with(:query => {:apiKey => "api_key", :twitter => "brawtest"}). to_return(:body => fixture("person.json"), :headers => {:content_type => "application/json; charset=utf-8"}) end it 'should rubyize keys' do expect(FullContact.person(email: "brawest@gmail.com").contact_info.given_name).to(eq("Brandon")) expect(FullContact.person(email: "brawest@gmail.com")).to satisfy do |v| v.keys.all? { |k| !k.match(/[A-Z]/) } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fullcontact-0.9.0 | spec/ruby_fullcontact/client/person_spec.rb |