Sha256: 9f6f57d39d67261f63a0118748a58d720dcac0198dd7c58c97cda3f8eaeeedbf
Contents?: true
Size: 1.24 KB
Versions: 21
Compression:
Stored size: 1.24 KB
Contents
require File.join(File.dirname(__FILE__),'..','api_helper') describe "RhoconnectApiGetDbDoc" do it_should_behave_like "ApiHelper" do it "should return db document by name" do data = {'1' => {'foo' => 'bar'}} set_state('abc:abc' => data) dockey = 'abc:abc' get "/rc/#{Rhoconnect::API_VERSION}/store/#{dockey}", {}, {Rhoconnect::API_TOKEN_HEADER => @api_token} last_response.should be_ok JSON.parse(last_response.body).should == data end it "should return db document by name and print deprecation warning with old route" do data = {'1' => {'foo' => 'bar'}} set_state('abc:abc' => data) post "/api/get_db_doc", {:doc => 'abc:abc'}, {Rhoconnect::API_TOKEN_HEADER => @api_token} last_response.should be_ok last_response.headers["Warning"].index('deprecated').should_not == nil JSON.parse(last_response.body).should == data end it "should return db document by name and data_type" do data = 'some string' set_state('abc:abc' => data) dockey = 'abc:abc' get "/rc/#{Rhoconnect::API_VERSION}/store/#{dockey}", {}, {Rhoconnect::API_TOKEN_HEADER => @api_token} last_response.should be_ok last_response.body.should == data end end end
Version data entries
21 entries across 21 versions & 1 rubygems