spec/api/rhosync_api_spec.rb in rhosync-2.1.3 vs spec/api/rhosync_api_spec.rb in rhosync-2.1.6

- old
+ new

@@ -150,26 +150,29 @@ RestClient.should_receive(:post).once RhosyncApi::list_sources('some_url',@api_token) end it "should list source attributes using direct api call" do - RhosyncApi::get_source_params('',@api_token,"SampleAdapter").should == [ + result = RhosyncApi::get_source_params( + '',@api_token,"SampleAdapter").sort {|x,y| y["name"] <=> x["name"] } + result.should == [ {"name"=>"rho__id", "value"=>"SampleAdapter", "type"=>"string"}, {"name"=>"source_id", "value"=>nil, "type"=>"integer"}, {"name"=>"name", "value"=>"SampleAdapter", "type"=>"string"}, - {"name"=>"url", "value"=>"", "type"=>"string"}, - {"name"=>"login", "value"=>"", "type"=>"string"}, - {"name"=>"password", "value"=>"", "type"=>"string"}, + {"name"=>"url", "value"=>"http://example.com", "type"=>"string"}, + {"name"=>"login", "value"=>"testuser", "type"=>"string"}, + {"name"=>"password", "value"=>"testpass", "type"=>"string"}, {"name"=>"priority", "value"=>3, "type"=>"integer"}, {"name"=>"callback_url", "value"=>nil, "type"=>"string"}, {"name"=>"poll_interval", "value"=>300, "type"=>"integer"}, {"name"=>"partition_type", "value"=>"user", "type"=>"string"}, {"name"=>"sync_type", "value"=>"incremental", "type"=>"string"}, {"name"=>"belongs_to", "type"=>"string", "value"=>nil}, {"name"=>"has_many", "type"=>"string", "value"=>"FixedSchemaAdapter,brand"}, + {"name"=>"id", "value"=>"SampleAdapter", "type"=>"string"}, {"name"=>"queue", "value"=>nil, "type"=>"string"}, {"name"=>"query_queue", "value"=>nil, "type"=>"string"}, - {"name"=>"cud_queue", "value"=>nil, "type"=>"string"}] + {"name"=>"cud_queue", "value"=>nil, "type"=>"string"}].sort {|x,y| y["name"] <=> x["name"] } end it "should list source attributes using rest call" do res = mock('HttpResponse') res.stub!(:body).and_return(["SimpleAdapter"].to_json) \ No newline at end of file