ticketmaster-basecamp 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/LICENSE +20 -0
- data/README.md +17 -0
- data/Rakefile +45 -0
- data/VERSION +1 -0
- data/lib/basecamp/basecamp.rb +638 -0
- data/lib/provider/basecamp.rb +28 -0
- data/lib/provider/comment.rb +27 -0
- data/lib/provider/project.rb +57 -0
- data/lib/provider/ticket.rb +115 -0
- data/lib/ticketmaster-basecamp.rb +5 -0
- data/spec/comments_spec.rb +67 -0
- data/spec/fixtures/comments/74197051.xml +13 -0
- data/spec/fixtures/comments/74197096.xml +13 -0
- data/spec/fixtures/comments.xml +47 -0
- data/spec/fixtures/projects/5220065.xml +16 -0
- data/spec/fixtures/projects/create.xml +0 -0
- data/spec/fixtures/projects.xml +18 -0
- data/spec/fixtures/todo_lists/9972756_items.xml +87 -0
- data/spec/fixtures/todo_lists/9973518_items.xml +92 -0
- data/spec/fixtures/todo_lists.xml +29 -0
- data/spec/projects_spec.rb +70 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +16 -0
- data/spec/ticketmaster-basecamp_spec.rb +9 -0
- data/spec/tickets_spec.rb +72 -0
- metadata +113 -0
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
2
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
3
|
+
require 'rubygems'
|
4
|
+
require 'ticketmaster'
|
5
|
+
require 'active_resource/http_mock'
|
6
|
+
require 'ticketmaster-basecamp'
|
7
|
+
require 'spec'
|
8
|
+
require 'spec/autorun'
|
9
|
+
|
10
|
+
Spec::Runner.configure do |config|
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
def fixture_for(name)
|
15
|
+
File.read(File.dirname(__FILE__) + '/fixtures/' + name + '.xml')
|
16
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "TicketmasterBasecamp" do
|
4
|
+
it "should be able to instantiate a new instance" do
|
5
|
+
@ticketmaster = TicketMaster.new(:basecamp, {:domain => 'ticketmaster.basecamphq.com', :token => '000000'})
|
6
|
+
@ticketmaster.should be_an_instance_of(TicketMaster)
|
7
|
+
@ticketmaster.should be_a_kind_of(TicketMaster::Provider::Basecamp)
|
8
|
+
end
|
9
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
2
|
+
|
3
|
+
describe "Ticketmaster::Provider::Basecamp::Ticket" do
|
4
|
+
before(:all) do
|
5
|
+
headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1wIGxhbW8='}
|
6
|
+
wheaders = headers.merge('Content-Type' => 'application/xml')
|
7
|
+
ActiveResource::HttpMock.respond_to do |mock|
|
8
|
+
mock.get '/projects/5220065.xml', headers, fixture_for('projects/5220065'), 200
|
9
|
+
mock.get '/projects/5220065/todo_lists.xml', headers, fixture_for('todo_lists'), 200
|
10
|
+
mock.get '/todo_lists/9973518/todo_items.xml', headers, fixture_for('todo_lists/9973518_items'), 200
|
11
|
+
mock.get '/todo_lists/9972756/todo_items.xml', headers, fixture_for('todo_lists/9972756_items'), 200
|
12
|
+
mock.put '/todo_items/62509330.xml', wheaders, '', 200
|
13
|
+
mock.post '/todo_lists/9972756/todo_items.xml', wheaders, '', 200
|
14
|
+
end
|
15
|
+
@project_id = 5220065
|
16
|
+
@ticket_id = 62509330
|
17
|
+
end
|
18
|
+
|
19
|
+
before(:each) do
|
20
|
+
@ticketmaster = TicketMaster.new(:basecamp, :domain => 'ticketmaster.basecamphq.com', :token => '000000')
|
21
|
+
@project = @ticketmaster.project(@project_id)
|
22
|
+
@klass = TicketMaster::Provider::Basecamp::Ticket
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should be able to load all tickets" do
|
26
|
+
@project.tickets.should be_an_instance_of(Array)
|
27
|
+
@project.tickets.first.should be_an_instance_of(@klass)
|
28
|
+
end
|
29
|
+
|
30
|
+
it "should be able to load all tickets based on an array of ids" do
|
31
|
+
@tickets = @project.tickets([@ticket_id])
|
32
|
+
@tickets.should be_an_instance_of(Array)
|
33
|
+
@tickets.first.should be_an_instance_of(@klass)
|
34
|
+
@tickets.first.id.should == @ticket_id
|
35
|
+
end
|
36
|
+
|
37
|
+
it "should be able to load all tickets based on attributes" do
|
38
|
+
@tickets = @project.tickets(:id => @ticket_id)
|
39
|
+
@tickets.should be_an_instance_of(Array)
|
40
|
+
@tickets.first.should be_an_instance_of(@klass)
|
41
|
+
@tickets.first.id.should == @ticket_id
|
42
|
+
end
|
43
|
+
|
44
|
+
it "should return the ticket class" do
|
45
|
+
@project.ticket.should == @klass
|
46
|
+
end
|
47
|
+
|
48
|
+
it "should be able to load a single ticket" do
|
49
|
+
@ticket = @project.ticket(@ticket_id)
|
50
|
+
@ticket.should be_an_instance_of(@klass)
|
51
|
+
@ticket.id.should == @ticket_id
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should be able to load a single ticket based on attributes" do
|
55
|
+
@ticket = @project.ticket(:id => @ticket_id)
|
56
|
+
@ticket.should be_an_instance_of(@klass)
|
57
|
+
@ticket.id.should == @ticket_id
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should be able to update and save a ticket" do
|
61
|
+
@ticket = @project.ticket(@ticket_id)
|
62
|
+
@ticket.save.should == nil
|
63
|
+
@ticket.description = 'hello'
|
64
|
+
@ticket.save.should == true
|
65
|
+
end
|
66
|
+
|
67
|
+
it "should be able to create a ticket" do
|
68
|
+
@ticket = @project.ticket!(:todo_list_id => 9972756, :title => 'Ticket #12', :description => 'Body')
|
69
|
+
@ticket.should be_an_instance_of(@klass)
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
metadata
ADDED
@@ -0,0 +1,113 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ticketmaster-basecamp
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- HybridGroup
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2010-07-23 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: rspec
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 13
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 2
|
33
|
+
- 9
|
34
|
+
version: 1.2.9
|
35
|
+
type: :development
|
36
|
+
version_requirements: *id001
|
37
|
+
description: This gem provides an interface to basecamp through the ticketmaster gem
|
38
|
+
email: hong.quach@abigfisch.com
|
39
|
+
executables: []
|
40
|
+
|
41
|
+
extensions: []
|
42
|
+
|
43
|
+
extra_rdoc_files:
|
44
|
+
- LICENSE
|
45
|
+
- README.md
|
46
|
+
files:
|
47
|
+
- .document
|
48
|
+
- .gitignore
|
49
|
+
- LICENSE
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- VERSION
|
53
|
+
- lib/basecamp/basecamp.rb
|
54
|
+
- lib/provider/basecamp.rb
|
55
|
+
- lib/provider/comment.rb
|
56
|
+
- lib/provider/project.rb
|
57
|
+
- lib/provider/ticket.rb
|
58
|
+
- lib/ticketmaster-basecamp.rb
|
59
|
+
- spec/comments_spec.rb
|
60
|
+
- spec/fixtures/comments.xml
|
61
|
+
- spec/fixtures/comments/74197051.xml
|
62
|
+
- spec/fixtures/comments/74197096.xml
|
63
|
+
- spec/fixtures/projects.xml
|
64
|
+
- spec/fixtures/projects/5220065.xml
|
65
|
+
- spec/fixtures/projects/create.xml
|
66
|
+
- spec/fixtures/todo_lists.xml
|
67
|
+
- spec/fixtures/todo_lists/9972756_items.xml
|
68
|
+
- spec/fixtures/todo_lists/9973518_items.xml
|
69
|
+
- spec/projects_spec.rb
|
70
|
+
- spec/spec.opts
|
71
|
+
- spec/spec_helper.rb
|
72
|
+
- spec/ticketmaster-basecamp_spec.rb
|
73
|
+
- spec/tickets_spec.rb
|
74
|
+
has_rdoc: true
|
75
|
+
homepage: http://github.com/kiafaldorius/ticketmaster-basecamp
|
76
|
+
licenses: []
|
77
|
+
|
78
|
+
post_install_message:
|
79
|
+
rdoc_options:
|
80
|
+
- --charset=UTF-8
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 3
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
none: false
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
hash: 3
|
98
|
+
segments:
|
99
|
+
- 0
|
100
|
+
version: "0"
|
101
|
+
requirements: []
|
102
|
+
|
103
|
+
rubyforge_project:
|
104
|
+
rubygems_version: 1.3.7
|
105
|
+
signing_key:
|
106
|
+
specification_version: 3
|
107
|
+
summary: The basecamp provider for ticketmaster
|
108
|
+
test_files:
|
109
|
+
- spec/comments_spec.rb
|
110
|
+
- spec/projects_spec.rb
|
111
|
+
- spec/spec_helper.rb
|
112
|
+
- spec/ticketmaster-basecamp_spec.rb
|
113
|
+
- spec/tickets_spec.rb
|