taskmapper-kanbanpad 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/.document +5 -0
  2. data/.rbenv-gemsets +1 -0
  3. data/.rbenv-version +1 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +15 -0
  6. data/Gemfile.lock +51 -0
  7. data/LICENSE +22 -0
  8. data/README.md +39 -0
  9. data/Rakefile +43 -0
  10. data/VERSION +1 -0
  11. data/lib/kanbanpad/kanbanpad-api.rb +126 -0
  12. data/lib/provider/comment.rb +69 -0
  13. data/lib/provider/kanbanpad.rb +34 -0
  14. data/lib/provider/project.rb +78 -0
  15. data/lib/provider/ticket.rb +127 -0
  16. data/lib/taskmapper-kanbanpad.rb +6 -0
  17. data/spec/fixtures/comments.json +1 -0
  18. data/spec/fixtures/comments/4ef2719bf17365000110df9e.json +1 -0
  19. data/spec/fixtures/projects.json +8 -0
  20. data/spec/fixtures/projects.xml +23 -0
  21. data/spec/fixtures/projects/be74b643b64e3dc79aa0.json +2 -0
  22. data/spec/fixtures/projects/be74b643b64e3dc79aa0.xml +13 -0
  23. data/spec/fixtures/projects/create.json +1 -0
  24. data/spec/fixtures/projects/create.xml +1 -0
  25. data/spec/fixtures/projects/test.rb +7 -0
  26. data/spec/fixtures/steps/4dc312f49bd0ff6c37000040.json +1 -0
  27. data/spec/fixtures/tasks.json +2 -0
  28. data/spec/fixtures/tasks.xml +25 -0
  29. data/spec/fixtures/tasks/4cd428c496f0734eef000007.json +3 -0
  30. data/spec/fixtures/tasks/4cd428c496f0734eef000007.xml +14 -0
  31. data/spec/fixtures/tasks/4cd428c496f0734eef000008.json +1 -0
  32. data/spec/fixtures/tasks/4cd428c496f0734eef000008.xml +13 -0
  33. data/spec/fixtures/tasks/4dc31c4c9bd0ff6c3700004e.json +1 -0
  34. data/spec/fixtures/tasks/create.xml +1 -0
  35. data/spec/project_comments_spec.rb +37 -0
  36. data/spec/projects_spec.rb +49 -0
  37. data/spec/spec.opts +3 -0
  38. data/spec/spec_helper.rb +14 -0
  39. data/spec/ticket_comments_spec.rb +55 -0
  40. data/spec/ticketmaster-kanbanpad_spec.rb +11 -0
  41. data/spec/tickets_spec.rb +105 -0
  42. data/taskmapper-kanbanpad.gemspec +98 -0
  43. metadata +172 -0
@@ -0,0 +1,11 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe "TaskMapper::Provider::Kanbanpad" do
4
+
5
+ it "should be able to instantiate a new instance" do
6
+ #@ticketmaster = TaskMapper.new(:kanbanpad, {:account => 'ticketmaster', :token => '000000'})
7
+ #@ticketmaster.should be_an_instance_of(TaskMapper)
8
+ #@ticketmaster.should be_a_kind_of(TaskMapper::Provider::Kanbanpad)
9
+ end
10
+
11
+ end
@@ -0,0 +1,105 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+
3
+ describe TaskMapper::Provider::Kanbanpad::Ticket do
4
+ before(:all) do
5
+ headers = {'Authorization' => 'Basic YWJjQGcuY29tOmllODIzZDYzanM='}
6
+ wheaders = headers.merge('Accept' => 'application/json')
7
+ pheaders = headers.merge("Content-Type" => "application/json")
8
+ post_data = {:tasks => {:title => 'new ticket'}}
9
+ ActiveResource::HttpMock.respond_to do |mock|
10
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0.json', wheaders, fixture_for('projects/be74b643b64e3dc79aa0'), 200
11
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks.json', wheaders, fixture_for('tasks'), 200
12
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks.json?backlog=yes&finished=yes', wheaders, fixture_for('tasks'), 200
13
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks/4cd428c496f0734eef000007.json', wheaders, fixture_for('tasks/4cd428c496f0734eef000007'), 200
14
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks/4cd428c496f0734eef000008.json', wheaders, fixture_for('tasks/4cd428c496f0734eef000008'), 200
15
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/steps/4dc312f49bd0ff6c37000040.json', wheaders, fixture_for('steps/4dc312f49bd0ff6c37000040'), 200
16
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/tasks/4dc31c4c9bd0ff6c3700004e.json', wheaders, fixture_for('tasks/4dc31c4c9bd0ff6c3700004e'), 200
17
+ mock.put '/api/v1/projects/be74b643b64e3dc79aa0/steps/4dc312f49bd0ff6c37000040/tasks/4cd428c496f0734eef000007.json', pheaders, fixture_for('tasks/4cd428c496f0734eef000007'), 200
18
+ mock.post '/api/v1/projects/be74b643b64e3dc79aa0/tasks.json', pheaders, fixture_for('tasks/4cd428c496f0734eef000007'), 200
19
+ mock.get '/api/v1/projects/be74b643b64e3dc79aa0/steps/4dc312f49bd0ff6c37000040/tasks/4cd428c496f0734eef000007.json', wheaders, fixture_for('tasks/4cd428c496f0734eef000007'), 200
20
+ end
21
+ @project_id = 'be74b643b64e3dc79aa0'
22
+ @ticket_id = '4cd428c496f0734eef000007'
23
+ @ticket_id_without_note = '4cd428c496f0734eef000008'
24
+ @ticket_id_without_assignee = '4dc31c4c9bd0ff6c3700004e'
25
+ end
26
+
27
+ before(:each) do
28
+ @taskmapper = TaskMapper.new(:kanbanpad, :username => 'abc@g.com', :password => 'ie823d63js')
29
+ @project = @taskmapper.project(@project_id)
30
+ @klass = TaskMapper::Provider::Kanbanpad::Ticket
31
+ @comment_klass = TaskMapper::Provider::Kanbanpad::Comment
32
+ end
33
+
34
+ it "should be able to load all tickets" do
35
+ @project.tickets.should be_an_instance_of(Array)
36
+ @project.tickets.first.should be_an_instance_of(@klass)
37
+ end
38
+
39
+ it "should be able to load all tickets based on an array of ids" do
40
+ @tickets = @project.tickets([@ticket_id])
41
+ @tickets.should be_an_instance_of(Array)
42
+ @tickets.first.should be_an_instance_of(@klass)
43
+ @tickets.first.id.should == '4cd428c496f0734eef000007'
44
+ end
45
+
46
+ it "should retrieve a ticket without notes" do
47
+ @ticket = @project.ticket(@ticket_id_without_note)
48
+ @ticket.should be_an_instance_of(@klass)
49
+ end
50
+
51
+ it "should be able to load all tickets based on attributes" do
52
+ @tickets = @project.tickets(:id => @ticket_id)
53
+ @tickets.should be_an_instance_of(Array)
54
+ @tickets.first.should be_an_instance_of(@klass)
55
+ @tickets.first.id.should == '4cd428c496f0734eef000007'
56
+ end
57
+
58
+ it "should return the ticket class" do
59
+ @project.ticket.should == @klass
60
+ end
61
+
62
+ it "should be able to load a single ticket" do
63
+ @ticket = @project.ticket(@ticket_id)
64
+ @ticket.should be_an_instance_of(@klass)
65
+ @ticket.id.should == @ticket_id
66
+ end
67
+
68
+ it "should be able to load a single ticket based on attributes" do
69
+ @ticket = @project.ticket(:id => @ticket_id)
70
+ @ticket.should be_an_instance_of(@klass)
71
+ @ticket.id.should == @ticket_id
72
+ end
73
+
74
+ it "should return nobody as assignee for an empty assignee from the api" do
75
+ @ticket = @project.ticket(@ticket_id_without_assignee)
76
+ @ticket.assignee.should == 'Nobody'
77
+ end
78
+
79
+ it "should be able to create a ticket for a given project" do
80
+ @ticket = @project.ticket!(:title => 'New ticket', :assignee => ['jhon'], :description => 'Ticket description')
81
+ @ticket.should be_an_instance_of(@klass)
82
+ end
83
+
84
+ it "should be able to update a ticket" do
85
+ pending
86
+ @ticket = @project.ticket(@ticket_id)
87
+ @ticket.title = "Hello World"
88
+ @ticket.save.should be_true
89
+ end
90
+
91
+ it "should contain all fields for tickets" do
92
+ ticket = @project.ticket(@ticket_id)
93
+ ticket.id.should == '4cd428c496f0734eef000007'
94
+ ticket.status.should == 'Finished'
95
+ ticket.priority.should == 'Not Urgent'
96
+ ticket.resolution.should be_nil
97
+ ticket.title.should == 'Fix UI detail'
98
+ ticket.created_at.should_not be_nil
99
+ ticket.updated_at.should_not be_nil
100
+ ticket.description.should be_nil
101
+ ticket.assignee.should == 'Rafael George'
102
+ ticket.requestor.should be_nil
103
+ ticket.project_id.should == 'be74b643b64e3dc79aa0'
104
+ end
105
+ end
@@ -0,0 +1,98 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "taskmapper-kanbanpad"
8
+ s.version = "0.7.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["HybridGroup"]
12
+ s.date = "2012-05-10"
13
+ s.description = "Allows taskmapper to interact with kanbanpad."
14
+ s.email = "sonia@hybridgroup.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE",
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ ".rbenv-gemsets",
22
+ ".rbenv-version",
23
+ ".travis.yml",
24
+ "Gemfile",
25
+ "Gemfile.lock",
26
+ "LICENSE",
27
+ "README.md",
28
+ "Rakefile",
29
+ "VERSION",
30
+ "lib/kanbanpad/kanbanpad-api.rb",
31
+ "lib/provider/comment.rb",
32
+ "lib/provider/kanbanpad.rb",
33
+ "lib/provider/project.rb",
34
+ "lib/provider/ticket.rb",
35
+ "lib/taskmapper-kanbanpad.rb",
36
+ "spec/fixtures/comments.json",
37
+ "spec/fixtures/comments/4ef2719bf17365000110df9e.json",
38
+ "spec/fixtures/projects.json",
39
+ "spec/fixtures/projects.xml",
40
+ "spec/fixtures/projects/be74b643b64e3dc79aa0.json",
41
+ "spec/fixtures/projects/be74b643b64e3dc79aa0.xml",
42
+ "spec/fixtures/projects/create.json",
43
+ "spec/fixtures/projects/create.xml",
44
+ "spec/fixtures/projects/test.rb",
45
+ "spec/fixtures/steps/4dc312f49bd0ff6c37000040.json",
46
+ "spec/fixtures/tasks.json",
47
+ "spec/fixtures/tasks.xml",
48
+ "spec/fixtures/tasks/4cd428c496f0734eef000007.json",
49
+ "spec/fixtures/tasks/4cd428c496f0734eef000007.xml",
50
+ "spec/fixtures/tasks/4cd428c496f0734eef000008.json",
51
+ "spec/fixtures/tasks/4cd428c496f0734eef000008.xml",
52
+ "spec/fixtures/tasks/4dc31c4c9bd0ff6c3700004e.json",
53
+ "spec/fixtures/tasks/create.xml",
54
+ "spec/project_comments_spec.rb",
55
+ "spec/projects_spec.rb",
56
+ "spec/spec.opts",
57
+ "spec/spec_helper.rb",
58
+ "spec/ticket_comments_spec.rb",
59
+ "spec/ticketmaster-kanbanpad_spec.rb",
60
+ "spec/tickets_spec.rb",
61
+ "taskmapper-kanbanpad.gemspec"
62
+ ]
63
+ s.homepage = "http://github.com/hybridgroup/taskmapper-kanbanpad"
64
+ s.require_paths = ["lib"]
65
+ s.rubygems_version = "1.8.17"
66
+ s.summary = "taskmapper Provider for Kanbanpad"
67
+
68
+ if s.respond_to? :specification_version then
69
+ s.specification_version = 3
70
+
71
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
72
+ s.add_runtime_dependency(%q<taskmapper>, ["~> 0.8"])
73
+ s.add_development_dependency(%q<rspec>, ["~> 2.8"])
74
+ s.add_development_dependency(%q<bundler>, ["~> 1.1"])
75
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6"])
76
+ s.add_development_dependency(%q<simplecov>, ["~> 0.5"])
77
+ s.add_development_dependency(%q<rcov>, ["~> 1.0"])
78
+ s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
79
+ else
80
+ s.add_dependency(%q<taskmapper>, ["~> 0.8"])
81
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
82
+ s.add_dependency(%q<bundler>, ["~> 1.1"])
83
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
84
+ s.add_dependency(%q<simplecov>, ["~> 0.5"])
85
+ s.add_dependency(%q<rcov>, ["~> 1.0"])
86
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
87
+ end
88
+ else
89
+ s.add_dependency(%q<taskmapper>, ["~> 0.8"])
90
+ s.add_dependency(%q<rspec>, ["~> 2.8"])
91
+ s.add_dependency(%q<bundler>, ["~> 1.1"])
92
+ s.add_dependency(%q<jeweler>, ["~> 1.6"])
93
+ s.add_dependency(%q<simplecov>, ["~> 0.5"])
94
+ s.add_dependency(%q<rcov>, ["~> 1.0"])
95
+ s.add_dependency(%q<rspec>, [">= 1.2.9"])
96
+ end
97
+ end
98
+
metadata ADDED
@@ -0,0 +1,172 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: taskmapper-kanbanpad
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.7.0
6
+ platform: ruby
7
+ authors:
8
+ - HybridGroup
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-05-10 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: taskmapper
17
+ requirement: &id001 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ~>
21
+ - !ruby/object:Gem::Version
22
+ version: "0.8"
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: rspec
28
+ requirement: &id002 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: "2.8"
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: *id002
37
+ - !ruby/object:Gem::Dependency
38
+ name: bundler
39
+ requirement: &id003 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ~>
43
+ - !ruby/object:Gem::Version
44
+ version: "1.1"
45
+ type: :development
46
+ prerelease: false
47
+ version_requirements: *id003
48
+ - !ruby/object:Gem::Dependency
49
+ name: jeweler
50
+ requirement: &id004 !ruby/object:Gem::Requirement
51
+ none: false
52
+ requirements:
53
+ - - ~>
54
+ - !ruby/object:Gem::Version
55
+ version: "1.6"
56
+ type: :development
57
+ prerelease: false
58
+ version_requirements: *id004
59
+ - !ruby/object:Gem::Dependency
60
+ name: simplecov
61
+ requirement: &id005 !ruby/object:Gem::Requirement
62
+ none: false
63
+ requirements:
64
+ - - ~>
65
+ - !ruby/object:Gem::Version
66
+ version: "0.5"
67
+ type: :development
68
+ prerelease: false
69
+ version_requirements: *id005
70
+ - !ruby/object:Gem::Dependency
71
+ name: rcov
72
+ requirement: &id006 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: "1.0"
78
+ type: :development
79
+ prerelease: false
80
+ version_requirements: *id006
81
+ - !ruby/object:Gem::Dependency
82
+ name: rspec
83
+ requirement: &id007 !ruby/object:Gem::Requirement
84
+ none: false
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: 1.2.9
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: *id007
92
+ description: Allows taskmapper to interact with kanbanpad.
93
+ email: sonia@hybridgroup.com
94
+ executables: []
95
+
96
+ extensions: []
97
+
98
+ extra_rdoc_files:
99
+ - LICENSE
100
+ - README.md
101
+ files:
102
+ - .document
103
+ - .rbenv-gemsets
104
+ - .rbenv-version
105
+ - .travis.yml
106
+ - Gemfile
107
+ - Gemfile.lock
108
+ - LICENSE
109
+ - README.md
110
+ - Rakefile
111
+ - VERSION
112
+ - lib/kanbanpad/kanbanpad-api.rb
113
+ - lib/provider/comment.rb
114
+ - lib/provider/kanbanpad.rb
115
+ - lib/provider/project.rb
116
+ - lib/provider/ticket.rb
117
+ - lib/taskmapper-kanbanpad.rb
118
+ - spec/fixtures/comments.json
119
+ - spec/fixtures/comments/4ef2719bf17365000110df9e.json
120
+ - spec/fixtures/projects.json
121
+ - spec/fixtures/projects.xml
122
+ - spec/fixtures/projects/be74b643b64e3dc79aa0.json
123
+ - spec/fixtures/projects/be74b643b64e3dc79aa0.xml
124
+ - spec/fixtures/projects/create.json
125
+ - spec/fixtures/projects/create.xml
126
+ - spec/fixtures/projects/test.rb
127
+ - spec/fixtures/steps/4dc312f49bd0ff6c37000040.json
128
+ - spec/fixtures/tasks.json
129
+ - spec/fixtures/tasks.xml
130
+ - spec/fixtures/tasks/4cd428c496f0734eef000007.json
131
+ - spec/fixtures/tasks/4cd428c496f0734eef000007.xml
132
+ - spec/fixtures/tasks/4cd428c496f0734eef000008.json
133
+ - spec/fixtures/tasks/4cd428c496f0734eef000008.xml
134
+ - spec/fixtures/tasks/4dc31c4c9bd0ff6c3700004e.json
135
+ - spec/fixtures/tasks/create.xml
136
+ - spec/project_comments_spec.rb
137
+ - spec/projects_spec.rb
138
+ - spec/spec.opts
139
+ - spec/spec_helper.rb
140
+ - spec/ticket_comments_spec.rb
141
+ - spec/ticketmaster-kanbanpad_spec.rb
142
+ - spec/tickets_spec.rb
143
+ - taskmapper-kanbanpad.gemspec
144
+ homepage: http://github.com/hybridgroup/taskmapper-kanbanpad
145
+ licenses: []
146
+
147
+ post_install_message:
148
+ rdoc_options: []
149
+
150
+ require_paths:
151
+ - lib
152
+ required_ruby_version: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ">="
156
+ - !ruby/object:Gem::Version
157
+ version: "0"
158
+ required_rubygems_version: !ruby/object:Gem::Requirement
159
+ none: false
160
+ requirements:
161
+ - - ">="
162
+ - !ruby/object:Gem::Version
163
+ version: "0"
164
+ requirements: []
165
+
166
+ rubyforge_project:
167
+ rubygems_version: 1.8.17
168
+ signing_key:
169
+ specification_version: 3
170
+ summary: taskmapper Provider for Kanbanpad
171
+ test_files: []
172
+