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

describe "Ticketmaster::Provider::Mingle::Project" do
  before(:all) do
    headers = {'Authorization' => 'Basic OjAwMDAwMA==', 'Accept' => 'application/xml'}
    headers_post = {'Authorization' => 'Basic OjAwMDAwMA==', 'Content-Type' => 'application/xml'}
    @identifier = 'test_project'
    ActiveResource::HttpMock.respond_to do |mock|
      mock.get '/api/v2/projects.xml', headers, fixture_for('projects'), 200
      mock.get '/api/v2/projects/test_project.xml', headers, fixture_for('projects/test_project'), 200
      #mock.get '/api/v2/projects/dumb.xml', headers, fixture_for('projects/dumb'), 200
      mock.post '/api/v2/projects.xml', headers_post, '', 201#, 'Location' => '/projects/dumb'
    end
  end

  before(:each) do 
    @ticketmaster = TicketMaster.new(:mingle, {:server => 'myserver.com', :username => 'anymoto', :password => '<PASSWORD>'})
    @klass = TicketMaster::Provider::Mingle::Project
  end

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

  it "should be able to load projects from an array of id's" do 
    @projects = @ticketmaster.projects([@identifier])
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
    @projects.first.identifier.should == @identifier
  end<commit_msg>Mocks modified<commit_after>require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Ticketmaster::Provider::Mingle::Project" do
  before(:all) do
    headers = {'Authorization' => 'Basic OjAwMDAwMA==', 'Accept' => 'application/xml'}
    headers_post = {'Authorization' => 'Basic OjAwMDAwMA==', 'Content-Type' => 'application/xml'}
    @identifier = 'test_project'
    ActiveResource::HttpMock.respond_to do |mock|
      mock.get '/api/v2/projects.xml', headers, fixture_for('projects'), 200
      mock.get '/api/v2/projects/test_project.xml', headers, fixture_for('projects/test_project'), 200
      #mock.get '/api/v2/projects/dumb.xml', headers, fixture_for('projects/dumb'), 200
      mock.post '/api/v2/projects.xml', headers_post, '', 200, 'Location' => '/projects/dumb'
    end
  end

  before(:each) do 
    @ticketmaster = TicketMaster.new(:mingle, {:server => 'myserver.com', :username => 'anymoto', :password => '<PASSWORD>'})
    @klass = TicketMaster::Provider::Mingle::Project
  end

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

  it "should be able to load projects from an array of id's" do 
    @projects = @ticketmaster.projects([@identifier])
    @projects.should be_an_instance_of(Array)
    @projects.first.should be_an_instance_of(@klass)
    @projects.first.identifier.should == @identifier
  end
{'fraction_non_alphanumeric': 0.15173116089613034, 'fraction_numerical': 0.010862186014935505, 'mean_word_length': 4.667307692307692, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, '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': '7210065', 'n_tokens_mistral': 984, 'n_tokens_neox': 938, 'n_words': 194}