Sha256: 96ccbf12ea1dbd0ecc05bf049d26a42131c64982118a5ab39b28a7cb63d8f8c0

Contents?: true

Size: 1.15 KB

Versions: 10

Compression:

Stored size: 1.15 KB

Contents

require 'helper'

class Moonshado::SmsTest < Test::Unit::TestCase
  context Moonshado::Sms::Keywords do
    setup do
      Moonshado::Sms.configure do |config|
        config.api_key = '20lsdjf2'
        config.keywords = {"test" => "http://test.com"}
      end
    end

    should "validate keywords" do
      assert(Moonshado::Sms::Keywords.valid_keywords?)
    end

    should "invalid keywords: nil" do
      Moonshado::Sms.configuration.keywords = nil
      assert_equal(false, Moonshado::Sms::Keywords.valid_keywords?)
    end

    should "invalid keywords: {}" do
      Moonshado::Sms.configuration.keywords = {}
      assert_equal(false, Moonshado::Sms::Keywords.valid_keywords?)
    end

    # should "list keywords" do
    #   WebMock.disable_net_connect!
    #   stub_request(:get, "http://20lsdjf2:@heroku.moonshado.com/keywords").with do |request|
    #     request.body == '{"keywords":"[{\"callback_url\":\"http://test.com",\"keyword\":\"test\"}]","stat":"ok"}'
    #   end
    # 
    #   assert_equal(Moonshado::Sms::Keywords.list, Yajl::Parser.new.parse('{"keywords":"[{\"callback_url\":\"http://test.com",\"keyword\":\"test\"}]","stat":"ok"}'))
    # end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
moonshado-sms-1.1.1 test/keywords_test.rb
moonshado-sms-1.1.1.rc2 test/keywords_test.rb
moonshado-sms-1.1.1.rc1 test/keywords_test.rb
moonshado-sms-1.1.0 test/keywords_test.rb
moonshado-sms-1.1.0.rc1 test/keywords_test.rb
moonshado-sms-1.0.1 test/keywords_test.rb
moonshado-sms-1.0.0 test/keywords_test.rb
moonshado-sms-0.5.0 test/keywords_test.rb
moonshado-sms-0.4.1 test/keywords_test.rb
moonshado-sms-0.4.0 test/keywords_test.rb