require 'spec_helper' describe Applicants::AffiliateTracking do it 'has offers id' do expect(Applicants::AffiliateTracking::HAS_OFFERS_OFFER_ID).to eq 2 end context "offer url" do it "transaction id is blank" do expect(Applicants::AffiliateTracking.has_offers_offer_url("")).to be_nil end it "generated url" do expect(Applicants::AffiliateTracking.has_offers_offer_url('sdfkd333').to_s).to eq 'http://usertesting.go2cloud.org/aff_lsr?offer_id=2&transaction_id=sdfkd333' end end context "goal url" do it "transaction id is blank" do expect(Applicants::AffiliateTracking.has_offers_goal_url("")).to be_nil end it "generated url" do expect(Applicants::AffiliateTracking.has_offers_goal_url('sdfkd333').to_s).to eq 'http://usertesting.go2cloud.org/aff_goal?a=lsr&goal_id=4&transaction_id=sdfkd333' end end end