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

describe Cloudist::Request do
  before {
    @mq_header = mock("MQ::Header")
    @mq_header.stubs(:properties).returns({:published_on=>Time.now.to_i - 60, :event_hash=>"foo", :content_type=>"application/json", :message_id=>"foo", :ttl=>300})
    
    q = Cloudist::JobQueue.new('test.queue')
    
    @request = Cloudist::Request.new(q, {:bread => 'white'}.to_json, @mq_header)
  }
  
  it "should return ttl" do
    @request.ttl.should == 300
  end
  
  it "should have a payload" do<commit_msg>Fixed broken request spec<commit_after>require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')

describe Cloudist::Request do
  before {
    @mq_header = mock("MQ::Header")
    @mq_header.stubs(:headers).returns({:published_on=>Time.now.to_i - 60, :event_hash=>"foo", :message_id=>"foo", :ttl=>300})
    
    q = Cloudist::JobQueue.new('test.queue')
    
    @request = Cloudist::Request.new(q, Marshal.dump({:bread => 'white'}), @mq_header)
  }
  
  it "should return ttl" do
    @request.ttl.should == 300
  end
  
  it "should have a payload" do
{'fraction_non_alphanumeric': 0.17888307155322863, 'fraction_numerical': 0.013961605584642234, 'mean_word_length': 4.120535714285714, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1980708', 'n_tokens_mistral': 421, 'n_tokens_neox': 403, 'n_words': 73}