         @giphy.getRandomResult [], callback
         callback.should.not.have.been.called
 
+    describe '.getUriFromResult', ->
+      it 'returns .images.original.url', ->
+        uri = @giphy.getUriFromResult sampleData
+        should.exist uri
+        uri.should.be.eql sampleData.images.original.url
+
+      it 'does not return a uri for invalid input', ->
+        uri = @giphy.getUriFromResult null
+        should.not.exist uri
+        uri = @giphy.getUriFromResult { }
+        should.not.exist uri
+        uri = @giphy.getUriFromResult { images: { } }
+        should.not.exist uri
+        uri = @giphy.getUriFromResult { images: { original: { } } }
+        should.not.exist uri
+
     describe '.getSearchUri', ->
       it 'searches using args', ->
         state = { args: 'testing' }

      it 'handles the response callback', ->
        state = { msg: 'msg', args: 'testing' }
        @fakes.stub @giphy.api, 'search', (options, callback) -> callback 'error', sampleCollectionResult
        @fakes.stub @giphy, 'handleResponse'
        @giphy.getSearchUri state
        @giphy.handleResponse.should.have.been.called.once
        @giphy.handleResponse.should.have.been.calledWith state, 'error', sinon.match.func

      it 'calls getRandomUri for empty args', ->
        @fakes.stub @giphy, 'getRandomUri'


    it 'does not respond to non-giphy command with args', ->
      testHubot @robot.respond, 'notgiphy test'
      @giphy.respond.should.not.have.been.called

    it 'does not respond to giphy command with a leading space', ->
      testHubot @robot.respond, ' giphy test'
      @giphy.respond.should.not.have.been.called

    it 'matches giphy command args', ->
