Sha256: 99d35a90807656999d97bfeef454e28896d0288b77d577a2973c5917b97da9ae

Contents?: true

Size: 1.1 KB

Versions: 1

Compression:

Stored size: 1.1 KB

Contents

require 'test_helper'

class InitTest < Test::Unit::TestCase

  context "Initialization" do

    should "can accept username and password and senderid" do
      Chutki.new({user: "username", password: "password", sender: "senderid"})
    end
  end

  context "Settings" do
    should "allow settings to be updated" do
      chutki = Chutki.new
      o = {user: "username", password: "password", sender: "senderid"}
      chutki.settings!(o)
      chutki.options[:user].should equal(o[:user])
      chutki.options[:sender].should equal(o[:sender])
      chutki.options[:password].should equal(o[:password])
    end
  end

  context "making remote calls" do
    setup do
      @response = "ok"
      Chutki.stubs(:post).returns(@response)
    end

    context "Sending SMS" do
      @chutki = Chutki.new({user: "username", password: "password", sender: "senderid"})
      @chutki.class.expects(:post).with("/sendhttp.php", :query => {:mobiles => "phonenumber", :message => "message", :user => "username", :password => "password", :sender => "senderid"})
      @chutki.send_sms("message","phonenumber",{})
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
chutki-1.1.0 test/test_init.rb