forked from sumoheavy/jira-ruby
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements JIRA::Resource::Attachment
- Loading branch information
Greg Signal
committed
Jan 10, 2012
1 parent
6156f19
commit 7a29fbe
Showing
5 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module JIRA | ||
module Resource | ||
|
||
class AttachmentFactory < BaseFactory ; end | ||
|
||
class Attachment < Base ; end | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'spec_helper' | ||
|
||
describe JIRA::Resource::Attachment do | ||
|
||
|
||
let(:client) do | ||
client = JIRA::Client.new('foo', 'bar') | ||
client.set_access_token('abc', '123') | ||
client | ||
end | ||
|
||
let(:key) { "10000" } | ||
|
||
let(:expected_attributes) do | ||
{ | ||
'self' => "http://localhost:2990/jira/rest/api/2/attachment/10000", | ||
'size' => 15360, | ||
'filename' => "ballmer.png" | ||
} | ||
end | ||
|
||
it_should_behave_like "a resource" | ||
it_should_behave_like "a resource with a singular GET endpoint" | ||
it_should_behave_like "a resource with a DELETE endpoint" | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"self": "http://localhost:2990/jira/rest/api/2/attachment/10000", | ||
"filename": "ballmer.png", | ||
"author": { | ||
"self": "http://localhost:2990/jira/rest/api/2/user?username=admin", | ||
"name": "admin", | ||
"avatarUrls": { | ||
"16x16": "http://localhost:2990/jira/secure/useravatar?size=small&avatarId=10122", | ||
"48x48": "http://localhost:2990/jira/secure/useravatar?avatarId=10122" | ||
}, | ||
"displayName": "admin", | ||
"active": true | ||
}, | ||
"created": "2012-01-11T10:54:50.875+1300", | ||
"size": 15360, | ||
"mimeType": "image/png", | ||
"properties": {}, | ||
"content": "http://localhost:2990/jira/secure/attachment/10000/ballmer.png", | ||
"thumbnail": "http://localhost:2990/jira/secure/thumbnail/10000/_thumb_10000.png" | ||
} |