From bd4639a122fff75729ce011146a303bf098377c9 Mon Sep 17 00:00:00 2001 From: s-ashwinkumar Date: Mon, 14 Aug 2017 12:26:29 -0700 Subject: [PATCH] Feature/adding file attachments (#108) * File attachments, delete and reload comments with story, create comments with epics * Specs, rest-calls refactor, README and bugfixes * CR changes - remove dead code, fix indentation, mark todo --- README.md | 11 +++++ lib/tracker_api.rb | 6 +++ lib/tracker_api/client.rb | 35 +++------------- lib/tracker_api/endpoints/attachment.rb | 38 +++++++++++++++++ lib/tracker_api/endpoints/attachments.rb | 22 ++++++++++ lib/tracker_api/endpoints/comment.rb | 11 ++++- lib/tracker_api/file_utility.rb | 16 +++++++ lib/tracker_api/resources/comment.rb | 35 ++++++++++++++++ lib/tracker_api/resources/epic.rb | 9 ++++ lib/tracker_api/resources/file_attachment.rb | 37 ++++++++++++++++ lib/tracker_api/resources/story.rb | 11 +++-- test/comment_test.rb | 42 +++++++++++++++++++ test/file_attachment_test.rb | 19 +++++++++ test/vcr/cassettes/create_attachments.json | 1 + test/vcr/cassettes/create_comment.json | 2 +- .../create_comment_with_attachment.json | 1 + test/vcr/cassettes/delete_an_attachment.json | 1 + test/vcr/cassettes/delete_attachments.json | 1 + test/vcr/cassettes/delete_comments.json | 1 + tracker_api.gemspec | 1 + 20 files changed, 263 insertions(+), 37 deletions(-) create mode 100644 lib/tracker_api/endpoints/attachment.rb create mode 100644 lib/tracker_api/endpoints/attachments.rb create mode 100644 lib/tracker_api/file_utility.rb create mode 100644 lib/tracker_api/resources/file_attachment.rb create mode 100644 test/file_attachment_test.rb create mode 100644 test/vcr/cassettes/create_attachments.json create mode 100644 test/vcr/cassettes/create_comment_with_attachment.json create mode 100644 test/vcr/cassettes/delete_an_attachment.json create mode 100644 test/vcr/cassettes/delete_attachments.json create mode 100644 test/vcr/cassettes/delete_comments.json diff --git a/README.md b/README.md index b806099..52f09b0 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,20 @@ comments = story.comments # co comment = story.create_comment(text: "Use the force!") # Create a new comment on the story +comment = story.create_comment(text: "Use the force again !", # Create a new comment on the story with + files: ['path/to/an/existing/file']) # file attachments + comment.text += " (please be careful)" comment.save # Update text of an existing comment +comment.delete # Delete an existing comment + +comment.create_attachments(files: ['path/to/an/existing/file']) # Add attachments to existing comment +comment.delete_attachments # Delete all attachments from a comment + +attachments = comment.attachments # Get attachments associated with a comment +attachments.first.delete # Delete a specific attachment +comment.attachments(reload: true) # Re-load the attachments after modification task = story.tasks.first # Get story tasks task.complete = true task.save # Mark a task complete diff --git a/lib/tracker_api.rb b/lib/tracker_api.rb index 9a4f850..33faeca 100644 --- a/lib/tracker_api.rb +++ b/lib/tracker_api.rb @@ -3,6 +3,8 @@ # dependencies require 'faraday' require 'faraday_middleware' +require 'pathname' +require 'mimemagic' if defined?(ActiveSupport) require 'active_support/core_ext/object/blank' @@ -26,6 +28,7 @@ module TrackerApi autoload :Error, 'tracker_api/error' autoload :Client, 'tracker_api/client' autoload :Logger, 'tracker_api/logger' + autoload :FileUtility, 'tracker_api/file_utility' module Errors class UnexpectedData < StandardError; end @@ -57,6 +60,8 @@ module Endpoints autoload :Webhook, 'tracker_api/endpoints/webhook' autoload :Webhooks, 'tracker_api/endpoints/webhooks' autoload :StoryTransitions, 'tracker_api/endpoints/story_transitions' + autoload :Attachment, 'tracker_api/endpoints/attachment' + autoload :Attachments, 'tracker_api/endpoints/attachments' end module Resources @@ -87,5 +92,6 @@ module Shared autoload :Comment, 'tracker_api/resources/comment' autoload :Webhook, 'tracker_api/resources/webhook' autoload :StoryTransition, 'tracker_api/resources/story_transition' + autoload :FileAttachment, 'tracker_api/resources/file_attachment' end end diff --git a/lib/tracker_api/client.rb b/lib/tracker_api/client.rb index f182e5a..53951a9 100644 --- a/lib/tracker_api/client.rb +++ b/lib/tracker_api/client.rb @@ -48,40 +48,15 @@ def initialize(options={}, &block) end end - # Make a HTTP GET request + # HTTP requests methods # # @param path [String] The path, relative to api endpoint # @param options [Hash] Query and header params for request # @return [Faraday::Response] - def get(path, options = {}) - request(:get, parse_query_and_convenience_headers(path, options)) - end - - # Make a HTTP POST request - # - # @param path [String] The path, relative to api endpoint - # @param options [Hash] Query and header params for request - # @return [Faraday::Response] - def post(path, options = {}) - request(:post, parse_query_and_convenience_headers(path, options)) - end - - # Make a HTTP PUT request - # - # @param path [String] The path, relative to api endpoint - # @param options [Hash] Query and header params for request - # @return [Faraday::Response] - def put(path, options = {}) - request(:put, parse_query_and_convenience_headers(path, options)) - end - - # Make a HTTP DELETE request - # - # @param path [String] The path, relative to api endpoint - # @param options [Hash] Query and header params for request - # @return [Faraday::Response] - def delete(path, options = {}) - request(:delete, parse_query_and_convenience_headers(path, options)) + %i{get post patch put delete}.each do |verb| + define_method verb do |path, options = {}| + request(verb, parse_query_and_convenience_headers(path, options)) + end end # Make one or more HTTP GET requests, optionally fetching diff --git a/lib/tracker_api/endpoints/attachment.rb b/lib/tracker_api/endpoints/attachment.rb new file mode 100644 index 0000000..a7f0951 --- /dev/null +++ b/lib/tracker_api/endpoints/attachment.rb @@ -0,0 +1,38 @@ +module TrackerApi + module Endpoints + class Attachment + attr_accessor :client + + def initialize(client) + @client = client + end + + def create(comment, file) + data = client.post("/projects/#{comment.project_id}/uploads", body: FileUtility.get_file_upload(file)).body + Resources::FileAttachment.new({ comment: comment }.merge(data)) + end + + # TODO : Discuss before implementing this as it orphans the file. + # It deletes source, but the file name appears in the comments + # def delete(comment, file_attachment_id) + # client.delete("/projects/#{comment.project_id}/stories/#{comment.story_id}/comments/#{comment.id}/file_attachments/#{file_attachment_id}").body + # end + + def get(comment) + data = client.get("/projects/#{comment.project_id}/stories/#{comment.story_id}/comments/#{comment.id}?fields=file_attachments").body["file_attachments"] + raise Errors::UnexpectedData, 'Array of file attachments expected' unless data.is_a? Array + + data.map do |file_attachment| + Resources::FileAttachment.new({ comment: comment }.merge(file_attachment)) + end + end + + # TODO : Implement this properly. + # This results in either content of the file or an S3 link. + # the S3 link is also present in big_url attribute. + # def download(download_path) + # client.get(download_path, url: '').body + # end + end + end +end diff --git a/lib/tracker_api/endpoints/attachments.rb b/lib/tracker_api/endpoints/attachments.rb new file mode 100644 index 0000000..eb7d6dd --- /dev/null +++ b/lib/tracker_api/endpoints/attachments.rb @@ -0,0 +1,22 @@ +module TrackerApi + module Endpoints + class Attachments + attr_accessor :client + + def initialize(client) + @client = client + end + + + def create(comment, files) + return [] if files.to_a.empty? + #Check files before upload to make it all or none. + FileUtility.check_files_exist(files) + attachment = Endpoints::Attachment.new(client) + files.map do | file | + attachment.create(comment, file) + end + end + end + end +end diff --git a/lib/tracker_api/endpoints/comment.rb b/lib/tracker_api/endpoints/comment.rb index 852da2a..22e25db 100644 --- a/lib/tracker_api/endpoints/comment.rb +++ b/lib/tracker_api/endpoints/comment.rb @@ -15,13 +15,20 @@ def create(project_id, story_id, params={}) def update(comment, params={}) raise ArgumentError, 'Valid comment required to update.' unless comment.instance_of?(Resources::Comment) - data = client.put("/projects/#{comment.project_id}/stories/#{comment.story_id}/comments/#{comment.id}", - params: params).body + path = "/projects/#{comment.project_id}/stories/#{comment.story_id}/comments/#{comment.id}" + path += "?fields=:default,file_attachments" if params.represented.file_attachment_ids_to_add.present? || params.represented.file_attachment_ids_to_remove.present? + data = client.put(path, params: params).body comment.attributes = data comment.clean! comment end + + def delete(comment) + raise ArgumentError, 'Valid comment required to update.' unless comment.instance_of?(Resources::Comment) + + client.delete("/projects/#{comment.project_id}/stories/#{comment.story_id}/comments/#{comment.id}").body + end end end end diff --git a/lib/tracker_api/file_utility.rb b/lib/tracker_api/file_utility.rb new file mode 100644 index 0000000..c957b1c --- /dev/null +++ b/lib/tracker_api/file_utility.rb @@ -0,0 +1,16 @@ +module TrackerApi + class FileUtility + class << self + def get_file_upload(file) + mime_type = MimeMagic.by_path(file) + { :file => Faraday::UploadIO.new(file, mime_type) } + end + + def check_files_exist(files) + files.each do | file | + raise ArgumentError, 'Attachment file not found.' unless Pathname.new(file).exist? + end + end + end + end +end \ No newline at end of file diff --git a/lib/tracker_api/resources/comment.rb b/lib/tracker_api/resources/comment.rb index 6ba3c18..638c357 100644 --- a/lib/tracker_api/resources/comment.rb +++ b/lib/tracker_api/resources/comment.rb @@ -14,7 +14,10 @@ class Comment attribute :created_at, DateTime attribute :updated_at, DateTime attribute :file_attachment_ids, [Integer] + attribute :file_attachments, [FileAttachment] attribute :google_attachment_ids, [Integer] + attribute :file_attachment_ids_to_add, [Integer] + attribute :file_attachment_ids_to_remove, [Integer] attribute :commit_identifier, String attribute :commit_type, String attribute :kind, String @@ -24,6 +27,8 @@ class UpdateRepresenter < Representable::Decorator property :id property :text + collection :file_attachment_ids_to_add + collection :file_attachment_ids_to_remove end def save @@ -31,6 +36,36 @@ def save Endpoints::Comment.new(client).update(self, UpdateRepresenter.new(Comment.new(self.dirty_attributes))) end + + def delete + raise ArgumentError, 'Cannot delete a comment with an unknown story_id.' if story_id.nil? + + Endpoints::Comment.new(client).delete(self) + end + + # @param [Hash] params attributes to create the comment with + # @return [Comment] newly created Comment + def create_attachments(params) + self.file_attachment_ids_to_add = Endpoints::Attachments.new(client).create(self, params[:files]).collect(&:id) + save + end + + def delete_attachments(attachment_ids = nil) + self.file_attachment_ids_to_remove = attachment_ids || attachments.collect(&:id) + save + end + + # Provides a list of all the attachments on the comment. + # + # @reload Boolean to reload the attachments + # @return [Array[FileAttachments]] + def attachments(reload: false) + if !reload && @file_attachments.present? + @file_attachments + else + @file_attachments = Endpoints::Attachment.new(client).get(self) + end + end end end end diff --git a/lib/tracker_api/resources/epic.rb b/lib/tracker_api/resources/epic.rb index 3f786a9..a4522a1 100644 --- a/lib/tracker_api/resources/epic.rb +++ b/lib/tracker_api/resources/epic.rb @@ -34,6 +34,15 @@ def save Endpoints::Epic.new(client).update(self, UpdateRepresenter.new(self)) end + + # @param [Hash] params attributes to create the comment with + # @return [Comment] newly created Comment + def create_comment(params) + files = params.delete(:files) + comment = Endpoints::Comment.new(client).create(project_id, id, params) + comment.create_attachments(files: files) if files.present? + comment + end end end end diff --git a/lib/tracker_api/resources/file_attachment.rb b/lib/tracker_api/resources/file_attachment.rb new file mode 100644 index 0000000..0ae5b77 --- /dev/null +++ b/lib/tracker_api/resources/file_attachment.rb @@ -0,0 +1,37 @@ +module TrackerApi + module Resources + class FileAttachment + include Shared::Base + + attribute :comment, Comment + + attribute :id, Integer + attribute :big_url, String + attribute :content_type, String + attribute :created_at, DateTime + attribute :download_url, String + attribute :filename, String + attribute :height, Integer + attribute :kind, String + attribute :size, Integer + attribute :thumbnail_url, String + attribute :thumbnailable, Boolean + attribute :uploaded, Boolean + attribute :uploader_id, Integer + attribute :width, Integer + + def delete + comment.delete_attachments([id]) + end + + # TODO : Implement download properly. + # Look at Attchment#download for more details + # The big_url actually has the AWS S3 link for the file + # def download + # file_data = Endpoints::Attachment.new(comment.client).download(download_url) + # File.open(filename, 'wb') { |fp| fp.write(file_data) } + # end + end + end +end + diff --git a/lib/tracker_api/resources/story.rb b/lib/tracker_api/resources/story.rb index 213ec99..0cb6cbe 100644 --- a/lib/tracker_api/resources/story.rb +++ b/lib/tracker_api/resources/story.rb @@ -108,11 +108,11 @@ def activity(params = {}) # # @param [Hash] params # @return [Array[Comment]] - def comments(params = {}) - if params.blank? && @comments.present? + def comments(reload: false) + if !reload && @comments.present? @comments else - @comments = Endpoints::Comments.new(client).get(project_id, id, params) + @comments = Endpoints::Comments.new(client).get(project_id, id) end end @@ -161,7 +161,10 @@ def create_task(params) # @param [Hash] params attributes to create the comment with # @return [Comment] newly created Comment def create_comment(params) - Endpoints::Comment.new(client).create(project_id, id, params) + files = params.delete(:files) + comment = Endpoints::Comment.new(client).create(project_id, id, params) + comment.create_attachments(files: files) if files.present? + comment end # Save changes to an existing Story. diff --git a/test/comment_test.rb b/test/comment_test.rb index 10d6b2b..0eb5e91 100644 --- a/test/comment_test.rb +++ b/test/comment_test.rb @@ -21,6 +21,18 @@ comment.clean?.must_equal true end + it 'can create a comment with file attachment' do + text = "Test creating a comment" + comment = nil + files = [File.expand_path('../Gemfile', File.dirname(__FILE__))] + VCR.use_cassette('create comment with attachment', record: :new_episodes) do + comment = story.create_comment(text: text, files: files) + end + comment.text.must_equal text + comment.attachments.size.must_equal 1 + comment.clean?.must_equal true + end + it 'can update an existing comment' do new_text = "#{existing_comment.text}+" existing_comment.text = new_text @@ -32,4 +44,34 @@ existing_comment.text.must_equal new_text existing_comment.clean?.must_equal true end + + it 'can create attachments in a comment' do + files = [File.expand_path('../Gemfile', File.dirname(__FILE__))] + VCR.use_cassette('create attachments', record: :new_episodes) do + existing_comment.create_attachments(files: files) + existing_comment.attachments.size.must_equal 1 + existing_comment.clean?.must_equal true + end + end + + it 'can delete attachments in a comment' do + files = [File.expand_path('../Gemfile', File.dirname(__FILE__))] + VCR.use_cassette('delete attachments', record: :new_episodes) do + existing_comment.create_attachments(files: files) + existing_comment.attachments.size.must_equal 1 + existing_comment.delete_attachments + existing_comment.attachments.size.must_equal 0 + end + end + + it 'can delete a comment' do + VCR.use_cassette('delete comment', record: :new_episodes) do + current_story = project.story(story_id) + new_comment_id = current_story.create_comment(text: "test comment").id + current_story.comments.last.id.must_equal new_comment_id + current_story.comments.last.delete + current_story = project.story(story_id) + current_story.comments.last.id.wont_equal new_comment_id + end + end end diff --git a/test/file_attachment_test.rb b/test/file_attachment_test.rb new file mode 100644 index 0000000..cc8aae2 --- /dev/null +++ b/test/file_attachment_test.rb @@ -0,0 +1,19 @@ +require_relative 'minitest_helper' + +describe TrackerApi::Resources::FileAttachment do + let(:pt_user) { PT_USER_1 } + let(:client) { TrackerApi::Client.new token: pt_user[:token] } + let(:project_id) { pt_user[:project_id] } + let(:project) { VCR.use_cassette('get project') { client.project(project_id) } } + let(:story_id) { '66728004' } + let(:story) { VCR.use_cassette('get story') { project.story(story_id) } } + + it 'can be deleted' do + VCR.use_cassette('delete an attachment', record: :new_episodes) do + comment_with_attachments = story.create_comment(text: "test comment", files: [File.expand_path('../Gemfile', File.dirname(__FILE__))]) + comment_with_attachments.attachments(reload: true).size.must_equal 1 + comment_with_attachments.attachments.first.delete + comment_with_attachments.attachments(reload: true).size.must_equal 1 + end + end +end \ No newline at end of file diff --git a/test/vcr/cassettes/create_attachments.json b/test/vcr/cassettes/create_attachments.json new file mode 100644 index 0000000..92b237d --- /dev/null +++ b/test/vcr/cassettes/create_attachments.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/uploads","body":{"encoding":"UTF-8","string":"-------------RubyMultipartPost-f92971c29179f1c8600d3c801d111643\r\nContent-Disposition: form-data; name=\"file\"; filename=\"Gemfile\"\r\nContent-Length: 144\r\nContent-Type: \r\nContent-Transfer-Encoding: binary\r\n\r\nsource 'https://rubygems.org'\n\n# Specify your gem's dependencies in tracker_api.gemspec\ngemspec\n\ngem 'coveralls', group: :test, require: false\n\n\r\n-------------RubyMultipartPost-f92971c29179f1c8600d3c801d111643--\r\n\r\n"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["multipart/form-data; boundary=-----------RubyMultipartPost-f92971c29179f1c8600d3c801d111643"],"Content-Length":["419"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["text/html; charset=utf-8"],"Date":["Mon, 12 Jun 2017 00:38:00 GMT"],"Etag":["\"a8b9a877d3f14ac48a476eaeb4f35435\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["c1138d0db7a079badade2f17f867e4a3"],"X-Runtime":["0.759489"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["249"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["bb5923e0-4375-4f87-4840-7a190c15dddf"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["256"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"file_attachment\",\"id\":80978531,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T00:38:00Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80978531/download\",\"uploaded\":false,\"big_url\":\"#\",\"thumbnail_url\":\"#\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 00:38:02 GMT"},{"request":{"method":"put","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/120836920?fields=%3Adefault%2Cfile_attachments","body":{"encoding":"UTF-8","string":"{\"text\":\"This is a comment.+++\",\"file_attachment_ids_to_add\":[80978531]}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 00:38:03 GMT"],"Etag":["\"548b5ab503974ac018634913e32d2470\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["bffffc79c6383a4707f91c4ce99dc29a"],"X-Runtime":["0.770136"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["251"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["97a2d369-aee0-4ef4-4b77-1bac61e9d31c"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["176"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"id\":120836920,\"story_id\":66728004,\"text\":\"This is a comment.+++\",\"person_id\":1266314,\"created_at\":\"2015-12-17T22:13:55Z\",\"updated_at\":\"2017-06-12T00:38:03Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 00:38:03 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/120836920?fields=file_attachments","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 00:39:15 GMT"],"Etag":["\"67297da329b710a401c06c8a8041af2b\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["e4ac99a72e254147411303f276501bbd"],"X-Runtime":["0.087594"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["251"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["1fbcc6ba-e694-4df3-7bf2-ebf775a817d1"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["1047"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"file_attachments\":[{\"kind\":\"file_attachment\",\"id\":80978531,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T00:38:00Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80978531/download\",\"uploaded\":true,\"big_url\":\"https://s3.amazonaws.com/prod.tracker2/resource/80978531/Gemfile_big?response-content-disposition=attachment&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEX3ET63U5T77TYA%2F20170612%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170612T003915Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=e7ec11a96a7993cc00e05d157e401535e9e3bed337a89030e4d521d37aba1a4c\",\"thumbnail_url\":\"https://s3.amazonaws.com/prod.tracker2/resource/80978531/Gemfile_thumb?response-content-disposition=attachment&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEX3ET63U5T77TYA%2F20170612%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170612T003915Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=8aaa3de2adab6ff6334e9cb5dab80d5fedb053505cb6ed6a4f3834861283b106\"}],\"id\":120836920}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 00:39:15 GMT"}],"recorded_with":"VCR 3.0.3"} \ No newline at end of file diff --git a/test/vcr/cassettes/create_comment.json b/test/vcr/cassettes/create_comment.json index 8887a9f..8b4a133 100644 --- a/test/vcr/cassettes/create_comment.json +++ b/test/vcr/cassettes/create_comment.json @@ -1 +1 @@ -{"http_interactions":[{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"UTF-8","string":"{\"text\":\"Test creating a comment\"}"},"headers":{"User-Agent":["Ruby/2.3.1 (x86_64-darwin15; ruby) TrackerApi/1.7.0 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Wed, 03 May 2017 23:29:39 GMT"],"Etag":["\"da92c553a8b55689359d240720a6f827\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["6d3b5cb0981a0bc97a2d9f0961324dcc"],"X-Runtime":["0.205489"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["232"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["dadd7537-fe99-477d-653f-1951652b588e"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["178"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"id\":170363243,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-05-03T23:29:39Z\",\"updated_at\":\"2017-05-03T23:29:39Z\"}"},"http_version":null},"recorded_at":"Wed, 03 May 2017 23:29:39 GMT"}],"recorded_with":"VCR 2.9.3"} \ No newline at end of file +{"http_interactions":[{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"UTF-8","string":"{\"text\":\"Test creating a comment\"}"},"headers":{"User-Agent":["Ruby/2.3.1 (x86_64-darwin15; ruby) TrackerApi/1.7.0 Faraday/0.9.2"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Wed, 03 May 2017 23:29:39 GMT"],"Etag":["\"da92c553a8b55689359d240720a6f827\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["6d3b5cb0981a0bc97a2d9f0961324dcc"],"X-Runtime":["0.205489"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["232"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["dadd7537-fe99-477d-653f-1951652b588e"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["178"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"id\":170363243,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-05-03T23:29:39Z\",\"updated_at\":\"2017-05-03T23:29:39Z\"}"},"http_version":null},"recorded_at":"Wed, 03 May 2017 23:29:39 GMT"},{"request":{"method":"put","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/170363243","body":{"encoding":"UTF-8","string":"{}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":400,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["no-cache"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 00:26:32 GMT"],"Server":["nginx + Phusion Passenger"],"Status":["400 Bad Request"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["bb9626e763089e372c20ed1f559a11a3"],"X-Runtime":["0.033398"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["ca7a904a-4c12-4513-68c8-b8a57e549abc"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["336"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"code\":\"invalid_parameter\",\"kind\":\"error\",\"error\":\"One or more request parameters was missing or invalid.\",\"general_problem\":\"this endpoint requires at least one of the following parameters: attachment_ids_to_remove, attachments_to_add, file_attachment_ids_to_add, file_attachment_ids_to_remove, google_attachment_ids_to_remove, text\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 00:26:32 GMT"}],"recorded_with":"VCR 3.0.3"} \ No newline at end of file diff --git a/test/vcr/cassettes/create_comment_with_attachment.json b/test/vcr/cassettes/create_comment_with_attachment.json new file mode 100644 index 0000000..757fe6a --- /dev/null +++ b/test/vcr/cassettes/create_comment_with_attachment.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"UTF-8","string":"{\"text\":\"Test creating a comment\"}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 00:26:33 GMT"],"Etag":["\"9dda396ee224c3f93cf6f3be29f80485\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["452d4de82b33b44859cb65ab066f2f13"],"X-Runtime":["0.217096"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["247"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["631eaad3-3b87-432f-432c-60a25fbf5c08"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["178"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"id\":173608993,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T00:26:32Z\",\"updated_at\":\"2017-06-12T00:26:32Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 00:26:33 GMT"},{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/uploads","body":{"encoding":"UTF-8","string":"-------------RubyMultipartPost-4971773737ecf554696d1ee47a4823e4\r\nContent-Disposition: form-data; name=\"file\"; filename=\"Gemfile\"\r\nContent-Length: 144\r\nContent-Type: \r\nContent-Transfer-Encoding: binary\r\n\r\nsource 'https://rubygems.org'\n\n# Specify your gem's dependencies in tracker_api.gemspec\ngemspec\n\ngem 'coveralls', group: :test, require: false\n\n\r\n-------------RubyMultipartPost-4971773737ecf554696d1ee47a4823e4--\r\n\r\n"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["multipart/form-data; boundary=-----------RubyMultipartPost-4971773737ecf554696d1ee47a4823e4"],"Content-Length":["419"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["text/html; charset=utf-8"],"Date":["Mon, 12 Jun 2017 00:26:34 GMT"],"Etag":["\"ee1c20be02be104aca3828b971b4a9c3\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["8f3a8669ee9c2aa65a5ed866f3f45779"],"X-Runtime":["0.612263"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["247"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["7e4da523-e419-4182-53dc-6c8fe0a1aa60"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["256"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"file_attachment\",\"id\":80978495,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T00:26:33Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80978495/download\",\"uploaded\":false,\"big_url\":\"#\",\"thumbnail_url\":\"#\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 00:26:34 GMT"},{"request":{"method":"put","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/173608993?fields=%3Adefault%2Cfile_attachments","body":{"encoding":"UTF-8","string":"{\"file_attachment_ids_to_add\":[80978495]}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 00:26:34 GMT"],"Etag":["\"2ff28be74a2168f5549472c305467c10\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["d45f4dc83fef95504ace7b97668c9f13"],"X-Runtime":["0.268861"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["248"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["b017eef5-a8f7-4dcc-5c9f-36b30b904cc3"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["456"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"file_attachments\":[{\"kind\":\"file_attachment\",\"id\":80978495,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T00:26:33Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80978495/download\",\"uploaded\":false,\"big_url\":\"#\",\"thumbnail_url\":\"#\"}],\"id\":173608993,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T00:26:32Z\",\"updated_at\":\"2017-06-12T00:26:34Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 00:26:34 GMT"}],"recorded_with":"VCR 3.0.3"} \ No newline at end of file diff --git a/test/vcr/cassettes/delete_an_attachment.json b/test/vcr/cassettes/delete_an_attachment.json new file mode 100644 index 0000000..ffcdc47 --- /dev/null +++ b/test/vcr/cassettes/delete_an_attachment.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"UTF-8","string":"{\"text\":\"test comment\"}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:32:05 GMT"],"Etag":["\"41563e5f526f1848b15c73c0e35da4d1\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["15f2a2b7c1afc750ed4bc4a9afd345eb"],"X-Runtime":["0.247018"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["274"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["1e6356c1-5099-4c60-731a-9795c8ee7f09"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["167"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"id\":173612961,\"story_id\":66728004,\"text\":\"test comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T04:32:05Z\",\"updated_at\":\"2017-06-12T04:32:05Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:32:05 GMT"},{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/uploads","body":{"encoding":"UTF-8","string":"-------------RubyMultipartPost-9d081de8e923a5f828bd19095e2d4614\r\nContent-Disposition: form-data; name=\"file\"; filename=\"Gemfile\"\r\nContent-Length: 144\r\nContent-Type: \r\nContent-Transfer-Encoding: binary\r\n\r\nsource 'https://rubygems.org'\n\n# Specify your gem's dependencies in tracker_api.gemspec\ngemspec\n\ngem 'coveralls', group: :test, require: false\n\n\r\n-------------RubyMultipartPost-9d081de8e923a5f828bd19095e2d4614--\r\n\r\n"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["multipart/form-data; boundary=-----------RubyMultipartPost-9d081de8e923a5f828bd19095e2d4614"],"Content-Length":["419"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["text/html; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:32:06 GMT"],"Etag":["\"668d416b586c3c528748c4c2e233a0da\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["e8798bd49ade52d16445406840c57697"],"X-Runtime":["0.690138"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["274"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["97f94c33-a3ef-4a1c-5ffc-bc3acfa17f69"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["256"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"file_attachment\",\"id\":80981051,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T04:32:06Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80981051/download\",\"uploaded\":false,\"big_url\":\"#\",\"thumbnail_url\":\"#\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:32:06 GMT"},{"request":{"method":"put","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/173612961?fields=%3Adefault%2Cfile_attachments","body":{"encoding":"UTF-8","string":"{\"file_attachment_ids_to_add\":[80981051]}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:32:07 GMT"],"Etag":["\"2a3224d7487c35a703524109f9a6f727\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["ef50a1a6b2e974e6d1963d866f031183"],"X-Runtime":["0.242017"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["275"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["d4b02942-2a14-4bbb-5b59-2ec23d0b20d0"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["445"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"file_attachments\":[{\"kind\":\"file_attachment\",\"id\":80981051,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T04:32:06Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80981051/download\",\"uploaded\":false,\"big_url\":\"#\",\"thumbnail_url\":\"#\"}],\"id\":173612961,\"story_id\":66728004,\"text\":\"test comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T04:32:05Z\",\"updated_at\":\"2017-06-12T04:32:07Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:32:07 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/173612961?fields=file_attachments","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:35:19 GMT"],"Etag":["\"99e589a588c8942ef0fee8918334f509\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["df1a64a0d133cfaa26e4860d26fff982"],"X-Runtime":["0.053143"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["276"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["f60cfa8a-a7e5-492f-7e23-87ccf8310fe6"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["1047"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"file_attachments\":[{\"kind\":\"file_attachment\",\"id\":80981051,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T04:32:06Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80981051/download\",\"uploaded\":true,\"big_url\":\"https://s3.amazonaws.com/prod.tracker2/resource/80981051/Gemfile_big?response-content-disposition=attachment&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEX3ET63U5T77TYA%2F20170612%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170612T043519Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=4d56cd218c2118fc8ecbe1a85f61a1a580e55d5a3005560e92840417cfb15456\",\"thumbnail_url\":\"https://s3.amazonaws.com/prod.tracker2/resource/80981051/Gemfile_thumb?response-content-disposition=attachment&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEX3ET63U5T77TYA%2F20170612%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170612T043519Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=d00de998df6c5ed301c9fc84b5d7889b19f55da0ffd169bc0596e06a7ef39212\"}],\"id\":173612961}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:35:19 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/173612961?fields=file_attachments","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:35:22 GMT"],"Etag":["\"99e589a588c8942ef0fee8918334f509\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["b152a48bc83e3fdc30a2b2476abe2136"],"X-Runtime":["0.039146"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["276"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["424956d8-fb29-47da-67be-81ae11805b88"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["1047"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"file_attachments\":[{\"kind\":\"file_attachment\",\"id\":80981051,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T04:32:06Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80981051/download\",\"uploaded\":true,\"big_url\":\"https://s3.amazonaws.com/prod.tracker2/resource/80981051/Gemfile_big?response-content-disposition=attachment&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEX3ET63U5T77TYA%2F20170612%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170612T043519Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=4d56cd218c2118fc8ecbe1a85f61a1a580e55d5a3005560e92840417cfb15456\",\"thumbnail_url\":\"https://s3.amazonaws.com/prod.tracker2/resource/80981051/Gemfile_thumb?response-content-disposition=attachment&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEX3ET63U5T77TYA%2F20170612%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170612T043519Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=d00de998df6c5ed301c9fc84b5d7889b19f55da0ffd169bc0596e06a7ef39212\"}],\"id\":173612961}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:35:22 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/173612961?fields=file_attachments","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:35:24 GMT"],"Etag":["\"99e589a588c8942ef0fee8918334f509\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["27ce8539c1aabd5c68cddc78487bb4eb"],"X-Runtime":["0.040199"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["276"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["9a969e64-dd8a-4eab-5e4b-36d2e7688ced"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["1047"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"file_attachments\":[{\"kind\":\"file_attachment\",\"id\":80981051,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T04:32:06Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80981051/download\",\"uploaded\":true,\"big_url\":\"https://s3.amazonaws.com/prod.tracker2/resource/80981051/Gemfile_big?response-content-disposition=attachment&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEX3ET63U5T77TYA%2F20170612%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170612T043519Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=4d56cd218c2118fc8ecbe1a85f61a1a580e55d5a3005560e92840417cfb15456\",\"thumbnail_url\":\"https://s3.amazonaws.com/prod.tracker2/resource/80981051/Gemfile_thumb?response-content-disposition=attachment&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJEX3ET63U5T77TYA%2F20170612%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20170612T043519Z&X-Amz-Expires=604800&X-Amz-SignedHeaders=host&X-Amz-Signature=d00de998df6c5ed301c9fc84b5d7889b19f55da0ffd169bc0596e06a7ef39212\"}],\"id\":173612961}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:35:24 GMT"},{"request":{"method":"put","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/173612961?fields=%3Adefault%2Cfile_attachments","body":{"encoding":"UTF-8","string":"{\"file_attachment_ids_to_remove\":[80981051]}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:36:28 GMT"],"Etag":["\"083511cb26d157694ae7271dee2e8505\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["4294da1f152d4294ee10f60706d10dec"],"X-Runtime":["0.221678"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["277"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["4834e483-a596-44b1-6669-4e8ef9edf255"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["189"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"file_attachments\":[],\"id\":173612961,\"story_id\":66728004,\"text\":\"test comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T04:32:05Z\",\"updated_at\":\"2017-06-12T04:36:28Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:36:28 GMT"}],"recorded_with":"VCR 3.0.3"} \ No newline at end of file diff --git a/test/vcr/cassettes/delete_attachments.json b/test/vcr/cassettes/delete_attachments.json new file mode 100644 index 0000000..99f608c --- /dev/null +++ b/test/vcr/cassettes/delete_attachments.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/uploads","body":{"encoding":"UTF-8","string":"-------------RubyMultipartPost-e71ba1127ef9ed2ec4fde8f7880298c3\r\nContent-Disposition: form-data; name=\"file\"; filename=\"Gemfile\"\r\nContent-Length: 144\r\nContent-Type: \r\nContent-Transfer-Encoding: binary\r\n\r\nsource 'https://rubygems.org'\n\n# Specify your gem's dependencies in tracker_api.gemspec\ngemspec\n\ngem 'coveralls', group: :test, require: false\n\n\r\n-------------RubyMultipartPost-e71ba1127ef9ed2ec4fde8f7880298c3--\r\n\r\n"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["multipart/form-data; boundary=-----------RubyMultipartPost-e71ba1127ef9ed2ec4fde8f7880298c3"],"Content-Length":["419"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["text/html; charset=utf-8"],"Date":["Mon, 12 Jun 2017 03:47:36 GMT"],"Etag":["\"86ede73aac9ecc4d5588eda2ccbc2818\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["6f6980b71782ac39fca091273526155f"],"X-Runtime":["0.755678"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["267"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["a8e2b681-474f-4bdd-41d7-19d4b9a71b05"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["256"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"file_attachment\",\"id\":80980447,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T03:47:35Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80980447/download\",\"uploaded\":false,\"big_url\":\"#\",\"thumbnail_url\":\"#\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 03:47:36 GMT"},{"request":{"method":"put","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/120836920?fields=%3Adefault%2Cfile_attachments","body":{"encoding":"UTF-8","string":"{\"file_attachment_ids_to_add\":[80980447]}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 03:47:37 GMT"],"Etag":["\"d8e22f1a89e6f112418dffc9e4e1c9ec\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["5e8bed6ad9e1b953ab31379c767c2eff"],"X-Runtime":["0.252265"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["268"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["a6203ab7-9817-4f61-7102-7ab438b99dda"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["454"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"file_attachments\":[{\"kind\":\"file_attachment\",\"id\":80980447,\"filename\":\"Gemfile\",\"created_at\":\"2017-06-12T03:47:35Z\",\"uploader_id\":1266314,\"thumbnailable\":false,\"size\":144,\"download_url\":\"/file_attachments/80980447/download\",\"uploaded\":false,\"big_url\":\"#\",\"thumbnail_url\":\"#\"}],\"id\":120836920,\"story_id\":66728004,\"text\":\"This is a comment.+++\",\"person_id\":1266314,\"created_at\":\"2015-12-17T22:13:55Z\",\"updated_at\":\"2017-06-12T03:47:37Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 03:47:37 GMT"},{"request":{"method":"put","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/120836920?fields=%3Adefault%2Cfile_attachments","body":{"encoding":"UTF-8","string":"{\"file_attachment_ids_to_remove\":[80980447]}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 03:47:38 GMT"],"Etag":["\"9a54d4be19aca5671ef5e2ddbaf3297c\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["56f21b1590d98b0b0f24766ea098dc61"],"X-Runtime":["0.234891"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["269"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["c5a95f67-7b90-4c70-4ac7-de424f4b7bc4"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["198"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"file_attachments\":[],\"id\":120836920,\"story_id\":66728004,\"text\":\"This is a comment.+++\",\"person_id\":1266314,\"created_at\":\"2015-12-17T22:13:55Z\",\"updated_at\":\"2017-06-12T03:47:37Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 03:47:38 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/120836920?fields=file_attachments","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 03:47:38 GMT"],"Etag":["\"b579761d6d39646cda5c21c8d061abfa\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["51d2b1192eeadd236741f5046d67a673"],"X-Runtime":["0.063679"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["269"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["fac0b9a4-d015-4770-4e0f-4193a18ca05c"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["38"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"file_attachments\":[],\"id\":120836920}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 03:47:38 GMT"}],"recorded_with":"VCR 3.0.3"} \ No newline at end of file diff --git a/test/vcr/cassettes/delete_comments.json b/test/vcr/cassettes/delete_comments.json new file mode 100644 index 0000000..eb0ce71 --- /dev/null +++ b/test/vcr/cassettes/delete_comments.json @@ -0,0 +1 @@ +{"http_interactions":[{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:07:14 GMT"],"Etag":["\"2cd092417cc39196e024d60eca4def51\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["b1595d423abeeeb3fbc97bba7fa6a0f7"],"X-Runtime":["0.048613"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["271"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["cff295b2-d392-4a81-4011-83eb4917e418"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["857"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"story\",\"id\":66728004,\"created_at\":\"2014-02-17T00:00:00Z\",\"updated_at\":\"2017-06-12T04:04:41Z\",\"story_type\":\"bug\",\"name\":\"Some product photos not scaled properly when browsing products+++++++++\",\"description\":\"++++++++++\",\"current_state\":\"started\",\"requested_by_id\":1266314,\"url\":\"https://www.pivotaltracker.com/story/show/66728004\",\"project_id\":1027488,\"owner_ids\":[1266314,1266316],\"labels\":[{\"id\":11049868,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"label1\",\"created_at\":\"2015-03-07T12:51:39Z\",\"updated_at\":\"2015-03-07T12:51:39Z\"},{\"id\":11049870,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"label2\",\"created_at\":\"2015-03-07T12:51:39Z\",\"updated_at\":\"2015-03-07T12:51:39Z\"},{\"id\":14060665,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"super-special-label\",\"created_at\":\"2016-02-12T23:45:13Z\",\"updated_at\":\"2016-02-12T23:45:13Z\"}],\"owned_by_id\":1266314}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:07:14 GMT"},{"request":{"method":"post","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"UTF-8","string":"{\"text\":\"test comment\"}"},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"],"Content-Type":["application/json"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:07:15 GMT"],"Etag":["\"690da1f5aa7d5d77f2b84757b62d5a74\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["3c0c84cd5052e5f1d0821700721e73e4"],"X-Runtime":["0.357093"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["272"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["34a416f9-75c7-4ef1-6d87-e2b3a8715b94"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["167"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"comment\",\"id\":173612365,\"story_id\":66728004,\"text\":\"test comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T04:07:15Z\",\"updated_at\":\"2017-06-12T04:07:15Z\"}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:07:15 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:07:15 GMT"],"Etag":["\"d4f26a8176147c7f26f8ba7d9e96bb10\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["76ff95f02d0a46b0e8910c6dd1816316"],"X-Runtime":["0.039079"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["272"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["1fc891c9-eb71-4e53-77d5-9e4eea0eed7c"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["1958"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"[{\"kind\":\"comment\",\"id\":120836920,\"story_id\":66728004,\"text\":\"This is a comment.+++\",\"person_id\":1266314,\"created_at\":\"2015-12-17T22:13:55Z\",\"updated_at\":\"2017-06-12T03:47:37Z\"},{\"kind\":\"comment\",\"id\":120836938,\"story_id\":66728004,\"text\":\"This is another comment.\",\"person_id\":1266314,\"created_at\":\"2015-12-17T22:14:04Z\",\"updated_at\":\"2015-12-17T22:14:04Z\"},{\"kind\":\"comment\",\"id\":155658605,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2016-11-16T14:17:47Z\",\"updated_at\":\"2016-11-16T14:17:47Z\"},{\"kind\":\"comment\",\"id\":170362899,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-05-03T23:23:33Z\",\"updated_at\":\"2017-05-03T23:23:33Z\"},{\"kind\":\"comment\",\"id\":170363243,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-05-03T23:29:39Z\",\"updated_at\":\"2017-05-03T23:29:39Z\"},{\"kind\":\"comment\",\"id\":173608993,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T00:26:32Z\",\"updated_at\":\"2017-06-12T02:13:39Z\"},{\"kind\":\"comment\",\"id\":173610235,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T02:16:13Z\",\"updated_at\":\"2017-06-12T02:16:15Z\"},{\"kind\":\"comment\",\"id\":173610269,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T02:19:10Z\",\"updated_at\":\"2017-06-12T02:19:13Z\"},{\"kind\":\"comment\",\"id\":173611341,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T03:19:55Z\",\"updated_at\":\"2017-06-12T03:19:58Z\"},{\"kind\":\"comment\",\"id\":173611767,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T03:41:24Z\",\"updated_at\":\"2017-06-12T03:41:26Z\"},{\"kind\":\"comment\",\"id\":173612365,\"story_id\":66728004,\"text\":\"test comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T04:07:15Z\",\"updated_at\":\"2017-06-12T04:07:15Z\"}]"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:07:15 GMT"},{"request":{"method":"delete","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments/173612365","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":204,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["no-cache"],"Date":["Mon, 12 Jun 2017 04:07:16 GMT"],"Server":["nginx + Phusion Passenger"],"Status":["204 No Content"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["invalidate, pass"],"X-Request-Id":["c56f43831c92d87ae6ac40229212050c"],"X-Runtime":["0.205759"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["273"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["7b4a7033-c274-4f52-6d66-281a3bfa88f5"],"X-Xss-Protection":["1; mode=block"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":""},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:07:16 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:07:16 GMT"],"Etag":["\"eec3b265138bb1155a01183e508d2dc8\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["086d2386852bb5b5226c7a3e18f94fd9"],"X-Runtime":["0.034774"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["273"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["37991ea4-0b56-4272-6aa9-a50e43ef8f03"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["857"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"{\"kind\":\"story\",\"id\":66728004,\"created_at\":\"2014-02-17T00:00:00Z\",\"updated_at\":\"2017-06-12T04:07:15Z\",\"story_type\":\"bug\",\"name\":\"Some product photos not scaled properly when browsing products+++++++++\",\"description\":\"++++++++++\",\"current_state\":\"started\",\"requested_by_id\":1266314,\"url\":\"https://www.pivotaltracker.com/story/show/66728004\",\"project_id\":1027488,\"owner_ids\":[1266314,1266316],\"labels\":[{\"id\":11049868,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"label1\",\"created_at\":\"2015-03-07T12:51:39Z\",\"updated_at\":\"2015-03-07T12:51:39Z\"},{\"id\":11049870,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"label2\",\"created_at\":\"2015-03-07T12:51:39Z\",\"updated_at\":\"2015-03-07T12:51:39Z\"},{\"id\":14060665,\"project_id\":1027488,\"kind\":\"label\",\"name\":\"super-special-label\",\"created_at\":\"2016-02-12T23:45:13Z\",\"updated_at\":\"2016-02-12T23:45:13Z\"}],\"owned_by_id\":1266314}"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:07:16 GMT"},{"request":{"method":"get","uri":"https://www.pivotaltracker.com/services/v5/projects/1027488/stories/66728004/comments","body":{"encoding":"US-ASCII","string":""},"headers":{"User-Agent":["Ruby/2.1.2 (x86_64-darwin16.0; ruby) TrackerApi/1.7.1 Faraday/0.12.1"],"X-TrackerToken":["d55c3bc1f74346b843ca84ba340b29bf"]}},"response":{"status":{"code":200,"message":null},"headers":{"Access-Control-Allow-Credentials":["false"],"Access-Control-Allow-Headers":["X-TrackerToken,DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,X-Tracker-Warn-Unless-Project-Version-Is"],"Access-Control-Allow-Methods":["GET, POST, PUT, DELETE, OPTIONS"],"Access-Control-Allow-Origin":["*"],"Cache-Control":["max-age=0, private, must-revalidate"],"Content-Type":["application/json; charset=utf-8"],"Date":["Mon, 12 Jun 2017 04:07:16 GMT"],"Etag":["\"f91060aa48f154a44408da1da7f2d96b\""],"Server":["nginx + Phusion Passenger"],"Status":["200 OK"],"Strict-Transport-Security":["max-age=31536000; includeSubDomains; preload"],"X-Content-Type-Options":["nosniff"],"X-Powered-By":["Phusion Passenger Enterprise"],"X-Rack-Cache":["miss"],"X-Request-Id":["0962d415aac240d888d2804805562cc0"],"X-Runtime":["0.040993"],"X-Tracker-Client-Pinger-Interval":["20"],"X-Tracker-Project-Version":["273"],"X-Ua-Compatible":["IE=Edge,chrome=1"],"X-Vcap-Request-Id":["fbeaf102-1e6d-42b8-670e-eb7236d7400c"],"X-Xss-Protection":["1; mode=block"],"Content-Length":["1790"],"Connection":["keep-alive"]},"body":{"encoding":"ASCII-8BIT","string":"[{\"kind\":\"comment\",\"id\":120836920,\"story_id\":66728004,\"text\":\"This is a comment.+++\",\"person_id\":1266314,\"created_at\":\"2015-12-17T22:13:55Z\",\"updated_at\":\"2017-06-12T03:47:37Z\"},{\"kind\":\"comment\",\"id\":120836938,\"story_id\":66728004,\"text\":\"This is another comment.\",\"person_id\":1266314,\"created_at\":\"2015-12-17T22:14:04Z\",\"updated_at\":\"2015-12-17T22:14:04Z\"},{\"kind\":\"comment\",\"id\":155658605,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2016-11-16T14:17:47Z\",\"updated_at\":\"2016-11-16T14:17:47Z\"},{\"kind\":\"comment\",\"id\":170362899,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-05-03T23:23:33Z\",\"updated_at\":\"2017-05-03T23:23:33Z\"},{\"kind\":\"comment\",\"id\":170363243,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-05-03T23:29:39Z\",\"updated_at\":\"2017-05-03T23:29:39Z\"},{\"kind\":\"comment\",\"id\":173608993,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T00:26:32Z\",\"updated_at\":\"2017-06-12T02:13:39Z\"},{\"kind\":\"comment\",\"id\":173610235,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T02:16:13Z\",\"updated_at\":\"2017-06-12T02:16:15Z\"},{\"kind\":\"comment\",\"id\":173610269,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T02:19:10Z\",\"updated_at\":\"2017-06-12T02:19:13Z\"},{\"kind\":\"comment\",\"id\":173611341,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T03:19:55Z\",\"updated_at\":\"2017-06-12T03:19:58Z\"},{\"kind\":\"comment\",\"id\":173611767,\"story_id\":66728004,\"text\":\"Test creating a comment\",\"person_id\":1266314,\"created_at\":\"2017-06-12T03:41:24Z\",\"updated_at\":\"2017-06-12T03:41:26Z\"}]"},"http_version":null},"recorded_at":"Mon, 12 Jun 2017 04:07:16 GMT"}],"recorded_with":"VCR 3.0.3"} \ No newline at end of file diff --git a/tracker_api.gemspec b/tracker_api.gemspec index dced4a3..a0b13c9 100644 --- a/tracker_api.gemspec +++ b/tracker_api.gemspec @@ -34,4 +34,5 @@ Gem::Specification.new do |spec| spec.add_dependency 'equalizer' spec.add_dependency 'representable' spec.add_dependency 'multi_json' + spec.add_dependency 'mimemagic' end