Skip to content

Commit

Permalink
Passing tests with authtoken
Browse files Browse the repository at this point in the history
  • Loading branch information
KentonWhite committed Sep 4, 2012
1 parent 38a1a29 commit ffe6440
Show file tree
Hide file tree
Showing 6 changed files with 1,582 additions and 1,015 deletions.
18 changes: 2 additions & 16 deletions spec/connection_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,10 @@
describe "Zohoho::Connection" do

before :each do
@username = 'kentonwhite'
@password = 'mopa3lwb'
@apikey = 'L-PvsrDNn9EIW2phA3vzp9YuL5REECogkQaMGWeIdlI$'
@conn = Zohoho::Connection.new('CRM', @username, @password, @apikey)
@authtoken = 'b0d8b1e2dbe42ef9d60f463fc94557ff'
@conn = Zohoho::Connection.new('CRM', @authtoken)
vcr_config 'connection'
end

it "should create the proper ticket url" do
ticket_url = "https://accounts.zoho.com/login"
@conn.ticket_url.should == ticket_url
end

it "should get a new ticket" do
VCR.use_cassette('ticket', :record => :new_episodes) do
@ticket = @conn.ticket
end
@ticket.should == '69617ea2200f689765ac4e1b44233128'
end

it "should make a simple call" do
VCR.use_cassette('call', :record => :new_episodes) do
Expand Down
13 changes: 4 additions & 9 deletions spec/crm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
@username = 'kentonwhite'
@password = 'mopa3lwb'
@apikey = 'L-PvsrDNn9EIW2phA3vzp9YuL5REECogkQaMGWeIdlI$'
@crm = Zohoho::Crm.new(@username, @password, @apikey)
vcr_config 'crm'
VCR.use_cassette('initialize', :record => :new_episodes) do
@crm = Zohoho::Crm.new(@username, @password, @apikey)
end
end

it 'should get contact Kenton White' do
Expand All @@ -23,14 +25,7 @@
end
@contact["CONTACTID"].should == "384023000000051007"
end

it 'should return nil for Johnny Depp' do
VCR.use_cassette('contact', :record => :new_episodes) do
@contact = @crm.contact "Johnny Depp"
end
@contact.should == nil
end


it 'should add Johnny Depp as a new contact' do
VCR.use_cassette('add_contact', :record => :new_episodes) do
@contact = @crm.add_contact "Johnny Depp"
Expand Down
Loading

0 comments on commit ffe6440

Please sign in to comment.