Sha256: a4d83b405ead93dce241c645289766a8f22f14cafcf27eccf973df6912a5e393
Contents?: true
Size: 1.22 KB
Versions: 1
Compression:
Stored size: 1.22 KB
Contents
require "webmock/test_unit" require "test/unit" require "shoulda" require_relative "../../lib/rsift" class CommentTest < Test::Unit::TestCase include WebMock::API def setup @api_url = YAML::load_file("config/keys.yml")["url"] @api_key = YAML::load_file("config/keys.yml")["api-key"] @username = YAML::load_file("config/keys.yml")["username"] @comment = Rsift::Comment.new(@api_url,@api_key,@username) end context "with comments" do setup do body = '{"success":true}' stub_request(:get, /api.datasift.net\/comment/). with(:headers => {'Accept'=>'*/*', 'User-Agent'=>'Ruby'}). to_return(:status => 200, :body => body, :headers => {}) end should "get a comment" do opts = {:stream_id => "1"} response = @comment.do("get",opts) assert_equal true, response["success"] end should "create a comment" do opts = {:stream_id => "1", :comment => "test comment"} response = @comment.do("create",opts) assert_equal true, response["success"] end should "flag a comment" do opts = {:comment_id => "1"} response = @comment.do("flag",opts) assert_equal true, response["success"] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rsift-0.3.1 | test/unit/comment_test.rb |