Sha256: a355ad0507fa1689fd9e3c3d745f3572b80b6eacbaac171961079b869504f26e

Contents?: true

Size: 884 Bytes

Versions: 7

Compression:

Stored size: 884 Bytes

Contents

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 0
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tracker_api-1.16.0 test/file_attachment_test.rb
tracker_api-1.15.0 test/file_attachment_test.rb
tracker_api-1.14.0 test/file_attachment_test.rb
tracker_api-1.13.0 test/file_attachment_test.rb
tracker_api-1.12.0 test/file_attachment_test.rb
tracker_api-1.11.0 test/file_attachment_test.rb
tracker_api-1.10.0 test/file_attachment_test.rb