ticketmaster-lighthouse 0.7.9 → 0.7.10

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.9
1
+ 0.7.10
@@ -17,7 +17,7 @@ module TicketMaster::Provider
17
17
  if auth.account.nil? or (auth.token.nil? and (auth.username.nil? and auth.password.nil?))
18
18
  raise "Please provide at least an account (subdomain) and token or username and password)"
19
19
  end
20
- ::Lighthouse::Base.format = :xml
20
+ ::Lighthouse::Base.format = :json
21
21
  ::Lighthouse.account = auth.account || auth.subdomain
22
22
  if auth.token
23
23
  ::Lighthouse.token = auth.token
@@ -3,12 +3,12 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
3
3
  describe "Ticketmaster::Provider::Lighthouse::Comment" do
4
4
  before(:all) do
5
5
  headers = {'X-LighthouseToken' => '000000'}
6
- wheaders = headers.merge('Content-Type' => 'application/xml')
6
+ wheaders = headers.merge('Content-Type' => 'application/json')
7
7
  ActiveResource::HttpMock.respond_to do |mock|
8
- mock.get '/projects/54448.xml', headers, fixture_for('projects/54448'), 200
9
- mock.get '/projects/54448/tickets.xml', headers, fixture_for('tickets'), 200
10
- mock.get '/projects/54448/tickets/2.xml', headers, fixture_for('tickets/2'), 200
11
- mock.put '/projects/54448/tickets/2.xml', wheaders, '', 200
8
+ mock.get '/projects/54448.json', headers, fixture_for('projects/54448'), 200
9
+ mock.get '/projects/54448/tickets.json', headers, fixture_for('tickets'), 200
10
+ mock.get '/projects/54448/tickets/2.json', headers, fixture_for('tickets/2'), 200
11
+ mock.put '/projects/54448/tickets/2.json', wheaders, '', 200
12
12
  end
13
13
  @project_id = 54448
14
14
  end
@@ -0,0 +1 @@
1
+ {"project":{"open_states":"new/f17 # You can add comments here\nopen/aaa # if you want to.","default_ticket_text":null,"description":"This is a test project created in order to test the ticketmaster-lighthouse gem.","hidden":false,"created_at":"Tue Jun 15 00:44:27 UTC 2010","name":"lh-test","default_assigned_user_id":null,"id":54448,"closed_states_list":"resolved,hold,invalid","open_states_list":"new,open","archived":false,"description_html":"<div><p>This is a test project created in order to test the\nticketmaster-lighthouse gem.</p></div>","permalink":"lh-test","send_changesets_to_events":true,"open_tickets_count":11,"public":true,"closed_states":"resolved/6A0 # You can customize colors\nhold/EB0 # with 3 or 6 character hex codes\ninvalid/A30 # 'A30' expands to 'AA3300'","default_milestone_id":null,"license":null,"updated_at":"Tue Jul 06 22:00:38 UTC 2010"}}
@@ -0,0 +1 @@
1
+ {"project":{"closed_states":"resolved/6A0 # You can customize colors\nhold/EB0 # with 3 or 6 character hex codes\ninvalid/A30 # 'A30' expands to 'AA3300'","open_states":"new/f17 # You can add comments here\nopen/aaa # if you want to.","description_html":null,"hidden":false,"open_tickets_count":0,"public":false,"archived":false,"created_at":"Wed Jul 07 18:06:46 UTC 2010","license":null,"open_states_list":"new,open","closed_states_list":"resolved,hold,invalid","name":"Project #1","updated_at":"Wed Jul 07 18:06:46 UTC 2010","id":55789,"default_assigned_user_id":null,"default_milestone_id":null,"send_changesets_to_events":true,"default_ticket_text":null,"description":null,"permalink":"project-1"}}
@@ -0,0 +1 @@
1
+ {"projects":[{"created_at":"Tue Jun 15 00:44:27 UTC 2010","description":"This is a test project created in order to test the ticketmaster-lighthouse gem.","send_changesets_to_events":true,"hidden":false,"license":null,"name":"lh-test","closed_states":"resolved/6A0 # You can customize colors\nhold/EB0 # with 3 or 6 character hex codes\ninvalid/A30 # 'A30' expands to 'AA3300'","default_milestone_id":null,"description_html":"<div><p>This is a test project created in order to test the\nticketmaster-lighthouse gem.</p></div>","closed_states_list":"resolved,hold,invalid","open_tickets_count":11,"permalink":"lh-test","archived":false,"default_assigned_user_id":null,"default_ticket_text":null,"open_states":"new/f17 # You can add comments here\nopen/aaa # if you want to.","public":true,"updated_at":"Tue Jul 06 22:00:38 UTC 2010","open_states_list":"new,open","id":54448}]}
@@ -0,0 +1 @@
1
+ {"ticket":{"user_id":67916,"tag":"choom heh pers \"tag1 tagster\" \"wha wha waa\"","closed":false,"raw_data":{"type":"binary","encoding":"base64"},"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","original_body_html":"<div><p>nt.,hntHOETUHAONTUHANOSTEUHANTOU</p></div>","creator_id":67916,"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","milestone_due_on":null,"assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","original_body":"nt.,hntHOETUHAONTUHANOSTEUHANTOU","versions":[{"user_id":67916,"tag":null,"type":"Ticket::Version","body":"nt.,hntHOETUHAONTUHANOSTEUHANTOU","closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Test ticket","creator_id":67916,"diffable_attributes":{},"milestone_id":null,"state":"new","assigned_user_name":null,"assigned_user_id":null,"attachments_count":0,"number":2,"priority":0,"project_id":54448,"creator_name":"Kia Kroas","body_html":"<div><p>nt.,hntHOETUHAONTUHANOSTEUHANTOU</p></div>","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Tue Jun 15 00:50:22 UTC 2010","updated_at":"Tue Jun 29 22:36:01 UTC 2010"},{"user_id":67916,"tag":null,"type":"Ticket::Version","body":null,"closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{"title":"Test ticket"},"milestone_id":null,"state":"new","assigned_user_name":null,"assigned_user_id":null,"attachments_count":0,"number":2,"priority":0,"project_id":54448,"creator_name":"Kia Kroas","body_html":null,"url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Tue Jun 15 01:39:36 UTC 2010","updated_at":"Tue Jun 15 01:39:40 UTC 2010"},{"user_id":67916,"tag":"\"tag1 tagster\"","type":"Ticket::Version","body":"Rokatoo","closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{"tag":null,"assigned_user":null,"priority":0},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":"<div><p>Rokatoo</p></div>","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Tue Jun 29 22:35:37 UTC 2010","updated_at":"Tue Jun 29 22:35:39 UTC 2010"},{"user_id":67916,"tag":"\"tag1 tagster\"","type":"Ticket::Version","body":"This is a ticket set from tm console","closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":"<div><p>This is a ticket set from tm console</p></div>","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 05:32:19 UTC 2010","updated_at":"Fri Jul 02 05:32:20 UTC 2010"},{"user_id":67916,"tag":"\"tag1 tagster\"","type":"Ticket::Version","body":"What the hey?","closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":"<div><p>What the hey?</p></div>","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 05:32:49 UTC 2010","updated_at":"Fri Jul 02 05:32:51 UTC 2010"},{"user_id":67916,"tag":"\"tag1 tagster\"","type":"Ticket::Version","body":"What the hey?","closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":"<div><p>What the hey?</p></div>","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 05:34:24 UTC 2010","updated_at":"Fri Jul 02 05:34:27 UTC 2010"},{"user_id":67916,"tag":"\"tag1 tagster\" \"wha wha waa\"","type":"Ticket::Version","body":null,"closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{"tag":"\"tag1 tagster\""},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":null,"url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 05:39:37 UTC 2010","updated_at":"Fri Jul 02 05:39:40 UTC 2010"},{"user_id":67916,"tag":"choom heh pers \"tag1 tagster\" \"wha wha waa\"","type":"Ticket::Version","body":null,"closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{"tag":"\"tag1 tagster\" \"wha wha waa\""},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":null,"url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 05:40:03 UTC 2010","updated_at":"Fri Jul 02 05:40:04 UTC 2010"},{"user_id":67916,"tag":"choom heh pers \"tag1 tagster\" \"wha wha waa\"","type":"Ticket::Version","body":"taoh natht aehu sa utaohe nsahu saeho nsahoeunsau '","closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":"<div><p>taoh natht aehu sa utaohe nsahu saeho nsahoeunsau '</p></div>","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 06:11:06 UTC 2010","updated_at":"Fri Jul 02 06:11:06 UTC 2010"},{"user_id":67916,"tag":"choom heh pers \"tag1 tagster\" \"wha wha waa\"","type":"Ticket::Version","body":null,"closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":null,"url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 20:01:33 UTC 2010","updated_at":"Fri Jul 02 20:01:36 UTC 2010"},{"user_id":67916,"tag":"choom heh pers \"tag1 tagster\" \"wha wha waa\"","type":"Ticket::Version","body":"tt","closed":false,"user_name":"Kia Kroas","permalink":"test-ticket","title":"Cheese cakes","creator_id":67916,"diffable_attributes":{},"milestone_id":null,"state":"new","assigned_user_name":"Kia Kroas","assigned_user_id":67916,"attachments_count":0,"number":2,"priority":2,"project_id":54448,"creator_name":"Kia Kroas","body_html":"<div><p>tt</p></div>","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 20:02:25 UTC 2010","updated_at":"Fri Jul 02 23:14:04 UTC 2010"}],"created_at":"Fri Jul 02 23:13:29 UTC 2010","latest_body":"nt.,hntHOETUHAONTUHANOSTEUHANTOU","updated_at":"Fri Jul 02 23:14:06 UTC 2010"}}
@@ -0,0 +1 @@
1
+ {"ticket":{"creator_id":67916,"milestone_due_on":null,"attachments_count":0,"user_id":67916,"assigned_user_id":null,"state":"new","milestone_id":null,"permalink":"tehantuehn","project_id":54448,"original_body":"cheuasoht atesuhn","versions":[{"body":"cheuasoht atesuhn","creator_id":67916,"attachments_count":0,"user_id":67916,"assigned_user_id":null,"diffable_attributes":{},"state":"new","milestone_id":null,"permalink":"tehantuehn","project_id":54448,"type":"Ticket::Version","closed":false,"creator_name":"Kia Kroas","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/5","number":5,"user_name":"Kia Kroas","title":"tehantuehn","updated_at":"Sat Jul 03 05:01:51 UTC 2010","body_html":"<div><p>cheuasoht atesuhn</p></div>","priority":3,"tag":null,"created_at":"Sat Jul 03 05:01:48 UTC 2010"},{"body":"New Body","creator_id":67916,"attachments_count":0,"user_id":67916,"assigned_user_id":null,"diffable_attributes":{},"state":"new","milestone_id":null,"permalink":"tehantuehn","project_id":54448,"type":"Ticket::Version","closed":false,"creator_name":"Kia Kroas","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/5","number":5,"user_name":"Kia Kroas","title":"tehantuehn","updated_at":"Thu Jul 08 02:11:21 UTC 2010","body_html":"<div><p>New Body</p></div>","priority":3,"tag":null,"created_at":"Thu Jul 08 02:11:17 UTC 2010"}],"closed":false,"creator_name":"Kia Kroas","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/5","number":5,"user_name":"Kia Kroas","latest_body":"cheuasoht atesuhn","original_body_html":"<div><p>cheuasoht atesuhn</p></div>","title":"tehantuehn","updated_at":"Thu Jul 08 02:11:21 UTC 2010","raw_data":{"type":"binary","encoding":"base64"},"priority":3,"tag":null,"created_at":"Sat Jul 03 05:01:48 UTC 2010"}}
@@ -0,0 +1 @@
1
+ {"ticket":{"original_body_html":"<div><p>Body</p></div>","creator_id":67916,"project_id":54448,"state":"new","title":"Ticket #12","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/12","original_body":"Body","latest_body":"Body","priority":10,"user_name":"Kia Kroas","attachments_count":0,"permalink":"ticket-12","milestone_id":null,"number":12,"tag":null,"user_id":67916,"creator_name":"Kia Kroas","raw_data":{"encoding":"base64","type":"binary"},"closed":false,"updated_at":"Thu Jul 08 01:50:26 UTC 2010","assigned_user_id":null,"created_at":"Thu Jul 08 01:50:26 UTC 2010","milestone_due_on":null}}
@@ -0,0 +1 @@
1
+ {"tickets":[{"project_id":54448,"updated_at":"Sat Jul 03 05:01:51 UTC 2010","closed":false,"creator_id":67916,"creator_name":"Kia Kroas","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/5","created_at":"Sat Jul 03 05:01:48 UTC 2010","state":"new","user_id":67916,"assigned_user_id":null,"raw_data":{"type":"binary","encoding":"base64"},"attachments_count":0,"priority":3,"tag":null,"user_name":"Kia Kroas","milestone_due_on":null,"number":5,"title":"tehantuehn","original_body":"cheuasoht atesuhn","latest_body":"cheuasoht atesuhn","original_body_html":"<div><p>cheuasoht atesuhn</p></div>","milestone_id":null,"permalink":"tehantuehn"},{"project_id":54448,"updated_at":"Sat Jul 03 05:00:48 UTC 2010","closed":false,"creator_id":67916,"creator_name":"Kia Kroas","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/4","created_at":"Sat Jul 03 05:00:48 UTC 2010","state":"new","user_id":67916,"assigned_user_id":null,"raw_data":{"type":"binary","encoding":"base64"},"attachments_count":0,"priority":2,"tag":null,"user_name":"Kia Kroas","milestone_due_on":null,"number":4,"title":"tehantuehn","original_body":null,"latest_body":null,"original_body_html":null,"milestone_id":null,"permalink":"tehantuehn"},{"project_id":54448,"updated_at":"Fri Jul 02 23:14:06 UTC 2010","closed":false,"creator_id":67916,"creator_name":"Kia Kroas","url":"http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2","created_at":"Fri Jul 02 23:13:29 UTC 2010","state":"new","user_id":67916,"assigned_user_id":67916,"raw_data":{"type":"binary","encoding":"base64"},"attachments_count":0,"priority":2,"tag":"choom heh pers \"tag1 tagster\" \"wha wha waa\"","user_name":"Kia Kroas","milestone_due_on":null,"number":2,"title":"Cheese cakes","original_body":"nt.,hntHOETUHAONTUHANOSTEUHANTOU","latest_body":"nt.,hntHOETUHAONTUHANOSTEUHANTOU","original_body_html":"<div><p>nt.,hntHOETUHAONTUHANOSTEUHANTOU</p></div>","milestone_id":null,"permalink":"test-ticket","assigned_user_name":"Kia Kroas"}]}
@@ -3,16 +3,16 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
3
3
  describe "Ticketmaster::Provider::Lighthouse::Project" do
4
4
  before(:all) do
5
5
  headers = {'X-LighthouseToken' => '000000'}
6
- wheaders = headers.merge('Content-Type' => 'application/xml')
6
+ wheaders = headers.merge('Content-Type' => 'application/json')
7
7
  @project_id = 54448
8
8
  ActiveResource::HttpMock.respond_to do |mock|
9
- mock.get '/projects.xml', headers, fixture_for('projects'), 200
10
- mock.get '/projects/54448.xml', headers, fixture_for('projects/54448'), 200
11
- mock.get '/projects/create.xml', headers, fixture_for('projects/create'), 200
12
- mock.delete '/projects/54448.xml', headers, '', 200
13
- mock.put '/projects/54448.xml', wheaders, '', 200
14
- mock.post '/projects.xml', wheaders, '', 201, 'Location' => '/projects/create.xml'
15
- mock.get '/projects/54448/tickets.xml', headers, fixture_for('tickets'), 200
9
+ mock.get '/projects.json', headers, fixture_for('projects'), 200
10
+ mock.get '/projects/54448.json', headers, fixture_for('projects/54448'), 200
11
+ mock.get '/projects/create.json', headers, fixture_for('projects/create'), 200
12
+ mock.delete '/projects/54448.json', headers, '', 200
13
+ mock.put '/projects/54448.json', wheaders, '', 200
14
+ mock.post '/projects.json', wheaders, '', 201, 'Location' => '/projects/create.json'
15
+ mock.get '/projects/54448/tickets.json', headers, fixture_for('tickets'), 200
16
16
  end
17
17
  end
18
18
 
@@ -20,7 +20,7 @@ describe "Ticketmaster::Provider::Lighthouse::Project" do
20
20
  @ticketmaster = TicketMaster.new(:lighthouse, :token => '000000', :account => 'ticketmaster')
21
21
  @klass = TicketMaster::Provider::Lighthouse::Project
22
22
  end
23
-
23
+
24
24
  it "should be able to load all projects" do
25
25
  @ticketmaster.projects.should be_an_instance_of(Array)
26
26
  @ticketmaster.projects.first.should be_an_instance_of(@klass)
data/spec/spec_helper.rb CHANGED
@@ -11,5 +11,5 @@ RSpec.configure do |config|
11
11
  end
12
12
 
13
13
  def fixture_for(name)
14
- File.read(File.dirname(__FILE__) + '/fixtures/' + name + '.xml')
14
+ File.read(File.dirname(__FILE__) + '/fixtures/' + name + '.json')
15
15
  end
@@ -6,7 +6,7 @@ describe "Ticketmaster::Provider::Lighthouse" do
6
6
  @ticketmaster = TicketMaster.new(:lighthouse, {:account => 'ticketmaster', :token => '000000'})
7
7
  headers = {'X-LighthouseToken' => '000000'}
8
8
  ActiveResource::HttpMock.respond_to do |mock|
9
- mock.get '/projects.xml', headers, fixture_for('projects'), 200
9
+ mock.get '/projects.json', headers, fixture_for('projects'), 200
10
10
  end
11
11
  end
12
12
 
data/spec/tickets_spec.rb CHANGED
@@ -3,61 +3,61 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
3
3
  describe "Ticketmaster::Provider::Lighthouse::Ticket" do
4
4
  before(:all) do
5
5
  headers = {'X-LighthouseToken' => '000000'}
6
- wheaders = headers.merge('Content-Type' => 'application/xml')
6
+ wheaders = headers.merge('Content-Type' => 'application/json')
7
7
  ActiveResource::HttpMock.respond_to do |mock|
8
- mock.get '/projects/54448.xml', headers, fixture_for('projects/54448'), 200
9
- mock.get '/projects/54448/tickets.xml', headers, fixture_for('tickets'), 200
8
+ mock.get '/projects/54448.json', headers, fixture_for('projects/54448'), 200
9
+ mock.get '/projects/54448/tickets.json', headers, fixture_for('tickets'), 200
10
10
  1.upto(100) do |page|
11
- mock.get "/projects/54448/tickets.xml?limit=100&page=#{page}", headers, fixture_for('tickets'), 200
11
+ mock.get "/projects/54448/tickets.json?limit=100&page=#{page}", headers, fixture_for('tickets'), 200
12
12
  end
13
- mock.get '/projects/54448/tickets/5.xml', headers, fixture_for('tickets/5'), 200
14
- mock.put '/projects/54448/tickets/5.xml', wheaders, '', 200
15
- mock.post '/projects/54448/tickets.xml', wheaders, fixture_for('tickets/create'), 200
13
+ mock.get '/projects/54448/tickets/5.json', headers, fixture_for('tickets/5'), 200
14
+ mock.put '/projects/54448/tickets/5.json', wheaders, '', 200
15
+ mock.post '/projects/54448/tickets.json', wheaders, fixture_for('tickets/create'), 200
16
16
  end
17
17
  @project_id = 54448
18
18
  end
19
-
19
+
20
20
  before(:each) do
21
21
  @ticketmaster = TicketMaster.new(:lighthouse, :account => 'ticketmaster', :token => '000000')
22
22
  @project = @ticketmaster.project(@project_id)
23
23
  @klass = TicketMaster::Provider::Lighthouse::Ticket
24
24
  end
25
-
25
+
26
26
  it "should be able to load all tickets" do
27
27
  @project.tickets.should be_an_instance_of(Array)
28
28
  @project.tickets.first.should be_an_instance_of(@klass)
29
29
  end
30
-
30
+
31
31
  it "should be able to load all tickets based on an array of ids" do
32
32
  @tickets = @project.tickets([5])
33
33
  @tickets.should be_an_instance_of(Array)
34
34
  @tickets.first.should be_an_instance_of(@klass)
35
35
  @tickets.first.id.should == 5
36
36
  end
37
-
37
+
38
38
  it "should be able to load all tickets based on attributes" do
39
39
  @tickets = @project.tickets(:id => 5)
40
40
  @tickets.should be_an_instance_of(Array)
41
41
  @tickets.first.should be_an_instance_of(@klass)
42
42
  @tickets.first.id.should == 5
43
43
  end
44
-
44
+
45
45
  it "should return the ticket class" do
46
46
  @project.ticket.should == @klass
47
47
  end
48
-
48
+
49
49
  it "should be able to load a single ticket" do
50
50
  @ticket = @project.ticket(5)
51
51
  @ticket.should be_an_instance_of(@klass)
52
52
  @ticket.id.should == 5
53
53
  end
54
-
54
+
55
55
  it "should be able to load a single ticket based on attributes" do
56
56
  @ticket = @project.ticket(:id => 5)
57
57
  @ticket.should be_an_instance_of(@klass)
58
58
  @ticket.id.should == 5
59
59
  end
60
-
60
+
61
61
  it "should be able to update and save a ticket" do
62
62
  pending
63
63
  @ticket = @project.ticket(5)
@@ -65,11 +65,10 @@ describe "Ticketmaster::Provider::Lighthouse::Ticket" do
65
65
  @ticket.description = 'hello'
66
66
  @ticket.save.should be_true
67
67
  end
68
-
68
+
69
69
  it "should be able to create a ticket" do
70
- pending
71
70
  @ticket = @project.ticket!(:title => 'Ticket #12', :description => 'Body')
72
71
  @ticket.should be_an_instance_of(@klass)
73
72
  end
74
-
73
+
75
74
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "ticketmaster-lighthouse"
8
- s.version = "0.7.9"
8
+ s.version = "0.7.10"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Hong"]
12
- s.date = "2012-03-27"
12
+ s.date = "2012-04-05"
13
13
  s.description = "Allows ticketmaster to interact with Lighthouse's issue tracking system."
14
14
  s.email = "hong.quach@abigfisch.com"
15
15
  s.extra_rdoc_files = [
@@ -31,12 +31,17 @@ Gem::Specification.new do |s|
31
31
  "lib/provider/ticket.rb",
32
32
  "lib/ticketmaster-lighthouse.rb",
33
33
  "spec/comments_spec.rb",
34
- "spec/fixtures/projects.xml",
34
+ "spec/fixtures/projects.json",
35
+ "spec/fixtures/projects/54448.json",
35
36
  "spec/fixtures/projects/54448.xml",
37
+ "spec/fixtures/projects/create.json",
36
38
  "spec/fixtures/projects/create.xml",
37
- "spec/fixtures/tickets.xml",
39
+ "spec/fixtures/tickets.json",
40
+ "spec/fixtures/tickets/2.json",
38
41
  "spec/fixtures/tickets/2.xml",
42
+ "spec/fixtures/tickets/5.json",
39
43
  "spec/fixtures/tickets/5.xml",
44
+ "spec/fixtures/tickets/create.json",
40
45
  "spec/fixtures/tickets/create.xml",
41
46
  "spec/projects_spec.rb",
42
47
  "spec/spec.opts",
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ticketmaster-lighthouse
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 23
4
5
  prerelease:
5
- version: 0.7.9
6
+ segments:
7
+ - 0
8
+ - 7
9
+ - 10
10
+ version: 0.7.10
6
11
  platform: ruby
7
12
  authors:
8
13
  - Hong
@@ -10,106 +15,143 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2012-03-27 00:00:00 Z
18
+ date: 2012-04-05 00:00:00 Z
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: ticketmaster
22
+ prerelease: false
23
+ type: :runtime
17
24
  requirement: &id001 !ruby/object:Gem::Requirement
18
25
  none: false
19
26
  requirements:
20
27
  - - "="
21
28
  - !ruby/object:Gem::Version
29
+ hash: 19
30
+ segments:
31
+ - 0
32
+ - 6
33
+ - 10
22
34
  version: 0.6.10
23
- type: :runtime
24
- prerelease: false
25
35
  version_requirements: *id001
26
36
  - !ruby/object:Gem::Dependency
27
37
  name: xml-simple
38
+ prerelease: false
39
+ type: :runtime
28
40
  requirement: &id002 !ruby/object:Gem::Requirement
29
41
  none: false
30
42
  requirements:
31
43
  - - ~>
32
44
  - !ruby/object:Gem::Version
45
+ hash: 13
46
+ segments:
47
+ - 1
48
+ - 1
33
49
  version: "1.1"
34
- type: :runtime
35
- prerelease: false
36
50
  version_requirements: *id002
37
51
  - !ruby/object:Gem::Dependency
38
52
  name: addressable
53
+ prerelease: false
54
+ type: :runtime
39
55
  requirement: &id003 !ruby/object:Gem::Requirement
40
56
  none: false
41
57
  requirements:
42
58
  - - ~>
43
59
  - !ruby/object:Gem::Version
60
+ hash: 7
61
+ segments:
62
+ - 2
63
+ - 2
44
64
  version: "2.2"
45
- type: :runtime
46
- prerelease: false
47
65
  version_requirements: *id003
48
66
  - !ruby/object:Gem::Dependency
49
67
  name: lighthouse-api
68
+ prerelease: false
69
+ type: :runtime
50
70
  requirement: &id004 !ruby/object:Gem::Requirement
51
71
  none: false
52
72
  requirements:
53
73
  - - ~>
54
74
  - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 2
78
+ - 0
55
79
  version: "2.0"
56
- type: :runtime
57
- prerelease: false
58
80
  version_requirements: *id004
59
81
  - !ruby/object:Gem::Dependency
60
82
  name: rspec
83
+ prerelease: false
84
+ type: :development
61
85
  requirement: &id005 !ruby/object:Gem::Requirement
62
86
  none: false
63
87
  requirements:
64
88
  - - ~>
65
89
  - !ruby/object:Gem::Version
90
+ hash: 19
91
+ segments:
92
+ - 2
93
+ - 8
66
94
  version: "2.8"
67
- type: :development
68
- prerelease: false
69
95
  version_requirements: *id005
70
96
  - !ruby/object:Gem::Dependency
71
97
  name: bundler
98
+ prerelease: false
99
+ type: :development
72
100
  requirement: &id006 !ruby/object:Gem::Requirement
73
101
  none: false
74
102
  requirements:
75
103
  - - ~>
76
104
  - !ruby/object:Gem::Version
105
+ hash: 13
106
+ segments:
107
+ - 1
108
+ - 1
77
109
  version: "1.1"
78
- type: :development
79
- prerelease: false
80
110
  version_requirements: *id006
81
111
  - !ruby/object:Gem::Dependency
82
112
  name: jeweler
113
+ prerelease: false
114
+ type: :development
83
115
  requirement: &id007 !ruby/object:Gem::Requirement
84
116
  none: false
85
117
  requirements:
86
118
  - - ~>
87
119
  - !ruby/object:Gem::Version
120
+ hash: 3
121
+ segments:
122
+ - 1
123
+ - 6
88
124
  version: "1.6"
89
- type: :development
90
- prerelease: false
91
125
  version_requirements: *id007
92
126
  - !ruby/object:Gem::Dependency
93
127
  name: simplecov
128
+ prerelease: false
129
+ type: :development
94
130
  requirement: &id008 !ruby/object:Gem::Requirement
95
131
  none: false
96
132
  requirements:
97
133
  - - ~>
98
134
  - !ruby/object:Gem::Version
135
+ hash: 1
136
+ segments:
137
+ - 0
138
+ - 5
99
139
  version: "0.5"
100
- type: :development
101
- prerelease: false
102
140
  version_requirements: *id008
103
141
  - !ruby/object:Gem::Dependency
104
142
  name: rcov
143
+ prerelease: false
144
+ type: :development
105
145
  requirement: &id009 !ruby/object:Gem::Requirement
106
146
  none: false
107
147
  requirements:
108
148
  - - ~>
109
149
  - !ruby/object:Gem::Version
150
+ hash: 15
151
+ segments:
152
+ - 1
153
+ - 0
110
154
  version: "1.0"
111
- type: :development
112
- prerelease: false
113
155
  version_requirements: *id009
114
156
  description: Allows ticketmaster to interact with Lighthouse's issue tracking system.
115
157
  email: hong.quach@abigfisch.com
@@ -135,12 +177,17 @@ files:
135
177
  - lib/provider/ticket.rb
136
178
  - lib/ticketmaster-lighthouse.rb
137
179
  - spec/comments_spec.rb
138
- - spec/fixtures/projects.xml
180
+ - spec/fixtures/projects.json
181
+ - spec/fixtures/projects/54448.json
139
182
  - spec/fixtures/projects/54448.xml
183
+ - spec/fixtures/projects/create.json
140
184
  - spec/fixtures/projects/create.xml
141
- - spec/fixtures/tickets.xml
185
+ - spec/fixtures/tickets.json
186
+ - spec/fixtures/tickets/2.json
142
187
  - spec/fixtures/tickets/2.xml
188
+ - spec/fixtures/tickets/5.json
143
189
  - spec/fixtures/tickets/5.xml
190
+ - spec/fixtures/tickets/create.json
144
191
  - spec/fixtures/tickets/create.xml
145
192
  - spec/projects_spec.rb
146
193
  - spec/spec.opts
@@ -161,12 +208,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
161
208
  requirements:
162
209
  - - ">="
163
210
  - !ruby/object:Gem::Version
211
+ hash: 3
212
+ segments:
213
+ - 0
164
214
  version: "0"
165
215
  required_rubygems_version: !ruby/object:Gem::Requirement
166
216
  none: false
167
217
  requirements:
168
218
  - - ">="
169
219
  - !ruby/object:Gem::Version
220
+ hash: 3
221
+ segments:
222
+ - 0
170
223
  version: "0"
171
224
  requirements: []
172
225
 
@@ -1,29 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <projects type="array">
3
- <project>
4
- <archived type="boolean">false</archived>
5
- <created-at type="datetime">2010-06-15T00:44:27Z</created-at>
6
- <default-assigned-user-id type="integer" nil="true"></default-assigned-user-id>
7
- <default-milestone-id type="integer" nil="true"></default-milestone-id>
8
- <default-ticket-text nil="true"></default-ticket-text>
9
- <description>This is a test project created in order to test the ticketmaster-lighthouse gem.</description>
10
- <description-html>&lt;div&gt;&lt;p&gt;This is a test project created in order to test the
11
- ticketmaster-lighthouse gem.&lt;/p&gt;&lt;/div&gt;</description-html>
12
- <hidden type="boolean">false</hidden>
13
- <id type="integer">54448</id>
14
- <license nil="true"></license>
15
- <name>lh-test</name>
16
- <open-tickets-count type="integer">11</open-tickets-count>
17
- <permalink>lh-test</permalink>
18
- <public type="boolean">true</public>
19
- <send-changesets-to-events type="boolean">true</send-changesets-to-events>
20
- <updated-at type="datetime">2010-07-06T22:00:38Z</updated-at>
21
- <open-states-list>new,open</open-states-list>
22
- <closed-states-list>resolved,hold,invalid</closed-states-list>
23
- <open-states>new/f17 # You can add comments here
24
- open/aaa # if you want to.</open-states>
25
- <closed-states>resolved/6A0 # You can customize colors
26
- hold/EB0 # with 3 or 6 character hex codes
27
- invalid/A30 # 'A30' expands to 'AA3300'</closed-states>
28
- </project>
29
- </projects>
@@ -1,79 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <tickets type="array">
3
- <ticket>
4
- <assigned-user-id type="integer" nil="true"></assigned-user-id>
5
- <attachments-count type="integer">0</attachments-count>
6
- <closed type="boolean">false</closed>
7
- <created-at type="datetime">2010-07-03T05:01:48Z</created-at>
8
- <creator-id type="integer">67916</creator-id>
9
- <milestone-due-on type="datetime" nil="true"></milestone-due-on>
10
- <milestone-id type="integer" nil="true"></milestone-id>
11
- <number type="integer">5</number>
12
- <permalink>tehantuehn</permalink>
13
- <priority type="integer">3</priority>
14
- <project-id type="integer">54448</project-id>
15
- <raw-data type="binary" encoding="base64" nil="true"></raw-data>
16
- <state>new</state>
17
- <tag nil="true"></tag>
18
- <title>tehantuehn</title>
19
- <updated-at type="datetime">2010-07-03T05:01:51Z</updated-at>
20
- <user-id type="integer">67916</user-id>
21
- <user-name>Kia Kroas</user-name>
22
- <creator-name>Kia Kroas</creator-name>
23
- <url>http://ticketmaster.lighthouseapp.com/projects/54448/tickets/5</url>
24
- <original-body>cheuasoht atesuhn</original-body>
25
- <latest-body>cheuasoht atesuhn</latest-body>
26
- <original-body-html>&lt;div&gt;&lt;p&gt;cheuasoht atesuhn&lt;/p&gt;&lt;/div&gt;</original-body-html>
27
- </ticket>
28
- <ticket>
29
- <assigned-user-id type="integer" nil="true"></assigned-user-id>
30
- <attachments-count type="integer">0</attachments-count>
31
- <closed type="boolean">false</closed>
32
- <created-at type="datetime">2010-07-03T05:00:48Z</created-at>
33
- <creator-id type="integer">67916</creator-id>
34
- <milestone-due-on type="datetime" nil="true"></milestone-due-on>
35
- <milestone-id type="integer" nil="true"></milestone-id>
36
- <number type="integer">4</number>
37
- <permalink>tehantuehn</permalink>
38
- <priority type="integer">2</priority>
39
- <project-id type="integer">54448</project-id>
40
- <raw-data type="binary" encoding="base64" nil="true"></raw-data>
41
- <state>new</state>
42
- <tag nil="true"></tag>
43
- <title>tehantuehn</title>
44
- <updated-at type="datetime">2010-07-03T05:00:48Z</updated-at>
45
- <user-id type="integer">67916</user-id>
46
- <user-name>Kia Kroas</user-name>
47
- <creator-name>Kia Kroas</creator-name>
48
- <url>http://ticketmaster.lighthouseapp.com/projects/54448/tickets/4</url>
49
- <original-body nil="true"></original-body>
50
- <latest-body nil="true"></latest-body>
51
- <original-body-html></original-body-html>
52
- </ticket>
53
- <ticket>
54
- <assigned-user-id type="integer">67916</assigned-user-id>
55
- <attachments-count type="integer">0</attachments-count>
56
- <closed type="boolean">false</closed>
57
- <created-at type="datetime">2010-07-02T23:13:29Z</created-at>
58
- <creator-id type="integer">67916</creator-id>
59
- <milestone-due-on type="datetime" nil="true"></milestone-due-on>
60
- <milestone-id type="integer" nil="true"></milestone-id>
61
- <number type="integer">2</number>
62
- <permalink>test-ticket</permalink>
63
- <priority type="integer">2</priority>
64
- <project-id type="integer">54448</project-id>
65
- <raw-data type="binary" encoding="base64" nil="true"></raw-data>
66
- <state>new</state>
67
- <tag>choom heh pers &quot;tag1 tagster&quot; &quot;wha wha waa&quot;</tag>
68
- <title>Cheese cakes</title>
69
- <updated-at type="datetime">2010-07-02T23:14:06Z</updated-at>
70
- <user-id type="integer">67916</user-id>
71
- <user-name>Kia Kroas</user-name>
72
- <creator-name>Kia Kroas</creator-name>
73
- <assigned-user-name>Kia Kroas</assigned-user-name>
74
- <url>http://ticketmaster.lighthouseapp.com/projects/54448/tickets/2</url>
75
- <original-body>nt.,hntHOETUHAONTUHANOSTEUHANTOU</original-body>
76
- <latest-body>nt.,hntHOETUHAONTUHANOSTEUHANTOU</latest-body>
77
- <original-body-html>&lt;div&gt;&lt;p&gt;nt.,hntHOETUHAONTUHANOSTEUHANTOU&lt;/p&gt;&lt;/div&gt;</original-body-html>
78
- </ticket>
79
- </tickets>