Sha256: 4b2c600adc101c817409625798ee83c6dc53e5cdcdc702c4fe4a36717f23d6c2
Contents?: true
Size: 1.5 KB
Versions: 16
Compression:
Stored size: 1.5 KB
Contents
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper') describe YouGotListed::Lead do before do @ygl = new_ygl @lead = YouGotListed::Lead.new(@ygl) @success_params = {:first_name => "You", :last_name => "GotListed", :email => "ygl@gmail.com"} @failed_params = {} end context "create" do context "a successful creation" do it "should not raise an exception" do lambda { VCR.use_cassette('lead.create.error') do @response = @lead.create(@success_params) end }.should_not raise_exception end end context "a failed creation" do it "should raise an exception" do lambda { VCR.use_cassette('lead.create.error') do @response = @lead.create(@failed_params) end }.should_not raise_exception end end end context "create!" do context "a successful creation" do it "should not raise an exception" do lambda { VCR.use_cassette('lead.create.error') do @response = @lead.create!(@success_params) end }.should_not raise_exception end end context "a failed creation" do it "should raise an exception" do lambda { VCR.use_cassette('lead.create.error') do @response = @lead.create!(@failed_params) end }.should raise_exception(YouGotListed::Error, "YouGotListed Error: Lead first name not specified. (code: 303)") end end end end
Version data entries
16 entries across 16 versions & 1 rubygems