taskmapper-basecamp 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/provider/ticket.rb +5 -1
- data/spec/tickets_spec.rb +49 -45
- data/taskmapper-basecamp.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.2
|
data/lib/provider/ticket.rb
CHANGED
@@ -121,6 +121,10 @@ module TaskMapper::Provider
|
|
121
121
|
self.position
|
122
122
|
end
|
123
123
|
|
124
|
+
def resolution
|
125
|
+
self.completed ? self.completed : 'In Progress'
|
126
|
+
end
|
127
|
+
|
124
128
|
def priority=(pri)
|
125
129
|
self.position = pri
|
126
130
|
end
|
@@ -146,7 +150,7 @@ module TaskMapper::Provider
|
|
146
150
|
end
|
147
151
|
|
148
152
|
def assignee
|
149
|
-
self.responsible_party_name
|
153
|
+
self.responsible_party_name ? self.responsible_party_name : 'Unassigned'
|
150
154
|
end
|
151
155
|
|
152
156
|
def requestor
|
data/spec/tickets_spec.rb
CHANGED
@@ -2,82 +2,86 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
|
3
3
|
describe TaskMapper::Provider::Basecamp::Ticket do
|
4
4
|
let(:project_id) { 5220065 }
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
ActiveResource::HttpMock.respond_to do |mock|
|
9
|
-
mock.get '/projects/5220065.xml', @headers, fixture_for('projects/5220065'), 200
|
10
|
-
end
|
11
|
-
@project = tm.project(project_id)
|
12
|
-
end
|
13
|
-
let(:ticket_id) { 133184178 }
|
5
|
+
let(:headers) { {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1w'} }
|
6
|
+
let(:wheaders) { headers.merge('Content-Type' => 'application/xml') }
|
7
|
+
let(:project) { tm.project(project_id) }
|
14
8
|
let(:tm) { TaskMapper.new(:basecamp, :domain => 'ticketmaster.basecamphq.com', :token => '000000') }
|
15
9
|
let(:ticket_class) { TaskMapper::Provider::Basecamp::Ticket }
|
16
10
|
|
17
|
-
|
18
|
-
before(:
|
11
|
+
context "Retrieve tickets" do
|
12
|
+
before(:all) do
|
19
13
|
ActiveResource::HttpMock.respond_to do |mock|
|
20
|
-
mock.get '/
|
14
|
+
mock.get '/projects/5220065.xml', headers, fixture_for('projects/5220065'), 200
|
15
|
+
mock.get '/todo_lists.xml?responsible_party=', headers, fixture_for('todo_list_with_items'), 200
|
21
16
|
end
|
22
17
|
end
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
18
|
+
|
19
|
+
shared_examples_for "ticket 133184178" do
|
20
|
+
its(:id) { should == 133184178 }
|
21
|
+
its(:title) { should match /updated/ }
|
22
|
+
its(:priority) { should == 1 }
|
23
|
+
its(:status) { should == 'incomplete' }
|
24
|
+
its(:resolution) { should == 'In Progress' }
|
25
|
+
its(:created_at) { should be_an_instance_of Time }
|
26
|
+
its(:updated_at) { should be_an_instance_of Time }
|
27
|
+
its(:description) { should match /updated/ }
|
28
|
+
its(:assignee) { should == 'Unassigned' }
|
29
|
+
its(:requestor) { should match /Clutch/ }
|
30
|
+
its(:project_id) { should == 5220065 }
|
28
31
|
end
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
it { subject.first.should be_an_instance_of(ticket_class) }
|
34
|
-
it { subject.first.id.should be_eql(ticket_id) }
|
35
|
-
end
|
33
|
+
describe "Reatrieve all" do
|
34
|
+
let(:tickets) { project.tickets }
|
35
|
+
subject { tickets }
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
37
|
+
its(:count) { should == 4 }
|
38
|
+
|
39
|
+
describe :first do
|
40
|
+
subject { tickets.first }
|
41
|
+
it_behaves_like "ticket 133184178"
|
42
|
+
end
|
42
43
|
end
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
44
|
+
|
45
|
+
pending "Search passing ids array'" do
|
46
|
+
let(:tickets) { project.tickets [133184178, 133180422] }
|
47
|
+
subject { tickets }
|
48
|
+
|
49
|
+
its(:count) { should == 2 }
|
50
|
+
|
51
|
+
describe :first do
|
52
|
+
subject { tickets.first }
|
53
|
+
it_behaves_like "ticket 133184178"
|
54
|
+
end
|
50
55
|
end
|
51
56
|
|
52
|
-
|
53
|
-
subject {
|
54
|
-
|
55
|
-
it { subject.id.should be_eql(ticket_id) }
|
57
|
+
describe "Find by id" do
|
58
|
+
subject { project.ticket 133184178 }
|
59
|
+
it_behaves_like "ticket 133184178"
|
56
60
|
end
|
57
61
|
end
|
58
62
|
|
59
|
-
|
63
|
+
pending "Update and creation" do
|
60
64
|
before(:all) do
|
61
65
|
ActiveResource::HttpMock.respond_to do |mock|
|
62
|
-
mock.post '/todo_lists/9972756/todo_items.xml',
|
63
|
-
mock.post '/projects/5220065/todo_lists.xml',
|
66
|
+
mock.post '/todo_lists/9972756/todo_items.xml', wheaders, '', 200
|
67
|
+
mock.post '/projects/5220065/todo_lists.xml', wheaders, '', 200
|
64
68
|
end
|
65
69
|
end
|
66
70
|
|
67
71
|
context "when an instance of ticket is changed and then called the save method" do
|
68
|
-
subject {
|
72
|
+
subject { project.ticket(133184178) }
|
69
73
|
pending { subject.save.should be_false }
|
70
74
|
end
|
71
75
|
|
72
76
|
context "when #ticket! method is call to a project instance" do
|
73
|
-
subject {
|
77
|
+
subject { project.ticket!(:todo_list_id => 9972756, :title => 'Ticket #12', :description => 'Body') }
|
74
78
|
it { should be_an_instance_of(ticket_class) }
|
75
79
|
it { subject.project_id.should_not be_nil }
|
76
80
|
it { subject.todo_list_id.should_not be_nil }
|
77
81
|
end
|
78
82
|
|
79
83
|
context "when #ticket! method is call without a todo_list_id" do
|
80
|
-
subject {
|
84
|
+
subject { project.ticket!(:title => 'Ticket #13', :description => 'Body') }
|
81
85
|
pending { should be_an_instance_of(ticket_class) }
|
82
86
|
pending { subject.project_id.should_not be_nil }
|
83
87
|
pending { subject.todo_list_id.should_not be_nil }
|
data/taskmapper-basecamp.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "taskmapper-basecamp"
|
8
|
-
s.version = "0.6.
|
8
|
+
s.version = "0.6.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["HybridGroup"]
|
12
|
-
s.date = "2012-08-
|
12
|
+
s.date = "2012-08-21"
|
13
13
|
s.description = "This gem provides an interface to basecamp through the taskmapper gem"
|
14
14
|
s.email = "hong.quach@abigfisch.com"
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: taskmapper-basecamp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-08-
|
12
|
+
date: 2012-08-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: taskmapper
|
@@ -177,7 +177,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
177
177
|
version: '0'
|
178
178
|
segments:
|
179
179
|
- 0
|
180
|
-
hash: -
|
180
|
+
hash: -39678771
|
181
181
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
182
182
|
none: false
|
183
183
|
requirements:
|