<commit_before>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Ticketmaster::Provider::Basecamp::Ticket" do
  before(:all) do
    headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1w'}
    wheaders = headers.merge('Content-Type' => 'application/xml')
    ActiveResource::HttpMock.respond_to do |mock|
      mock.get '/projects/5220065.xml', headers, fixture_for('projects/5220065'), 200
      mock.get '/projects/5220065/todo_lists.xml', headers, fixture_for('todo_lists'), 200
      mock.get '/todo_lists/9973518/todo_items.xml', headers, fixture_for('todo_lists/9973518_items'), 200
      mock.get '/todo_lists/9972756/todo_items.xml', headers, fixture_for('todo_lists/9972756_items'), 200
      mock.put '/todo_items/62509330.xml', wheaders, '', 200
      mock.post '/todo_lists/9972756/todo_items.xml', wheaders, '', 200
    end
    @project_id = 5220065
    @ticket_id = 62509330
  end
  
  before(:each) do
    @ticketmaster = TicketMaster.new(:basecamp, :domain => 'ticketmaster.basecamphq.com', :token => '<PASSWORD>')
    @project = @ticketmaster.project(@project_id)
    @klass = TicketMaster::Provider::Basecamp::Ticket
  end
  
  it "should be able to load all tickets" do
    @project.tickets.should be_an_instance_of(Array)
    @project.tickets.first.should be_an_instance_of(@klass)
  end
  
  it "should be able to load all tickets based on an array of ids" do
    @tickets = @project.tickets([@ticket_id])
    @tickets.should be_an_instance_of(Array)
    @tickets.first.should be_an_instance_of(@klass)
    @tickets.first.id.should == @ticket_id
  end
  
  it "should be able to load all tickets based on attributes" do
    @tickets = @project.tickets(:id => @ticket_id)
    @tickets.should be_an_instance_of(Array)
    @tickets.first.should be_an_instance_of(@klass)
    @tickets.first.id.should == @ticket_id
  end
  
  it "should return the ticket class" do
    @project.ticket.should == @klass
  end
  
  it "should be able to load a single ticket" do
    @ticket = @project.ticket(@ticket_id)
    @ticket.should be_an_instance_of(@klass)
    @ticket.id.should == @ticket_id
  end
  
  it "should be able to load a single ticket based on attributes" do
    @ticket = @project.ticket(:id => @ticket_id)
    @ticket.should be_an_instance_of(@klass)
    @ticket.id.should == @ticket_id
  end
  
  it "should be able to update and save a ticket" do
    pending
    @ticket = @project.ticket(@ticket_id)
    @ticket.save.should == nil
    @ticket.description = 'hello'
    @ticket.save.should == true
  end

  it "should be able to create a ticket" do
    pending
    @ticket = @project.ticket!(:todo_list_id => 9972756, :title => 'Ticket #12', :description => 'Body')
    @ticket.should be_an_instance_of(@klass)
  end
  
end<commit_msg>pending removed from create and update ticket spec<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Ticketmaster::Provider::Basecamp::Ticket" do
  before(:all) do
    headers = {'Authorization' => 'Basic MDAwMDAwOkJhc2VjYW1w'}
    wheaders = headers.merge('Content-Type' => 'application/xml')
    ActiveResource::HttpMock.respond_to do |mock|
      mock.get '/projects/5220065.xml', headers, fixture_for('projects/5220065'), 200
      mock.get '/projects/5220065/todo_lists.xml', headers, fixture_for('todo_lists'), 200
      mock.get '/todo_lists/9973518/todo_items.xml', headers, fixture_for('todo_lists/9973518_items'), 200
      mock.get '/todo_lists/9972756/todo_items.xml', headers, fixture_for('todo_lists/9972756_items'), 200
      mock.put '/todo_items/62509330.xml', wheaders, '', 200
      mock.post '/todo_lists/9972756/todo_items.xml', wheaders, '', 200
    end
    @project_id = 5220065
    @ticket_id = 62509330
  end

  before(:each) do
    @ticketmaster = TicketMaster.new(:basecamp, :domain => 'ticketmaster.basecamphq.com', :token => '<PASSWORD>')
    @project = @ticketmaster.project(@project_id)
    @klass = TicketMaster::Provider::Basecamp::Ticket
  end

  it "should be able to load all tickets" do
    @project.tickets.should be_an_instance_of(Array)
    @project.tickets.first.should be_an_instance_of(@klass)
  end

  it "should be able to load all tickets based on an array of ids" do
    @tickets = @project.tickets([@ticket_id])
    @tickets.should be_an_instance_of(Array)
    @tickets.first.should be_an_instance_of(@klass)
    @tickets.first.id.should == @ticket_id
  end

  it "should be able to load all tickets based on attributes" do
    @tickets = @project.tickets(:id => @ticket_id)
    @tickets.should be_an_instance_of(Array)
    @tickets.first.should be_an_instance_of(@klass)
    @tickets.first.id.should == @ticket_id
  end

  it "should return the ticket class" do
    @project.ticket.should == @klass
  end

  it "should be able to load a single ticket" do
    @ticket = @project.ticket(@ticket_id)
    @ticket.should be_an_instance_of(@klass)
    @ticket.id.should == @ticket_id
  end

  it "should be able to load a single ticket based on attributes" do
    @ticket = @project.ticket(:id => @ticket_id)
    @ticket.should be_an_instance_of(@klass)
    @ticket.id.should == @ticket_id
  end

  it "should be able to update and save a ticket" do
    @ticket = @project.ticket(@ticket_id)
    @ticket.save.should == nil
    @ticket.description = 'hello'
    @ticket.save.should == true
  end

  it "should be able to create a ticket" do
    @ticket = @project.ticket!(:todo_list_id => 9972756, :title => 'Ticket #12', :description => 'Body')
    @ticket.should be_an_instance_of(@klass)
  end

end
{'fraction_non_alphanumeric': 0.1260096930533118, 'fraction_numerical': 0.03877221324717286, 'mean_word_length': 3.992831541218638, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '471332', 'n_tokens_mistral': 2097, 'n_tokens_neox': 1890, 'n_words': 436}