Sha256: 1b28762d1d446b02c4c0de0da250851d43f18fb5ed37cc3e6c7e7d80aaed5ecf

Contents?: true

Size: 1.23 KB

Versions: 7

Compression:

Stored size: 1.23 KB

Contents

require 'test_helper'

class ContentTest < Minitest::Test
  describe "API Call: content" do
    before do
      api_url = 'http://api.sailthru.com'
      @secret = 'my_secret'
      @api_key = 'my_api_key'
      @sailthru_client = Sailthru::Client.new(@api_key, @secret, api_url)
      @api_call_url = sailthru_api_call_url(api_url, 'content')
    end

    it "can push content with title, url, *array* tags and vars" do
      title = 'unix is awesome'
      url = 'http://example.com/hello-world'
      date = nil
      tags = ['unix', 'linux']
      vars = {:price => 55, :description => 'Hello World'}
      stub_post(@api_call_url, 'content_valid.json')
      response = @sailthru_client.push_content(title, url, date = nil, tags = tags, vars = vars)
      refute_nil response['content']
    end

    it "can push content with title, url, *string* tags and vars" do
      title = 'unix is awesome'
      url = 'http://example.com/hello-world'
      date = nil
      tags = 'unix, linux'
      vars = {:price => 55, :description => 'Hello World'}
      stub_post(@api_call_url, 'content_valid.json')
      response = @sailthru_client.push_content(title, url, date = nil, tags = tags, vars = vars)
      refute_nil response['content']
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
sailthru-client-4.1.0 test/sailthru/content_test.rb
sailthru-client-4.0.7 test/sailthru/content_test.rb
sailthru-client-4.0.6 test/sailthru/content_test.rb
sailthru-client-4.0.3 test/sailthru/content_test.rb
sailthru-client-4.0.2 test/sailthru/content_test.rb
sailthru-client-4.0.1 test/sailthru/content_test.rb
sailthru-client-4.0.0 test/sailthru/content_test.rb