<commit_before>require 'spec_helper'

describe "Sessions API Resource" do
  before do
    Veezi.configure do |config|
      config.api_key = "1234567890"
      config.endpoint_url = "http://planetargon.com"
    end

    @client = Veezi.client
  end

  context "All" do
    before do
      response = File.new(File.dirname(__FILE__) + '/fixtures/json/sessions.json')
      stub_request(:get, /.*planetargon.com.*/).to_return { |request| { :body => response } }
    end

    it "should return an array" do
      expect(@client.sessions.all).to be_an_instance_of(Array)
    end

    it "should have two films" do
      expect(@client.sessions.all.size).to eq 2
    end

    it "should have Contraband and The Godfather as the film time title names" do
      expect(@client.sessions.all.map { |movie| movie["Title"] } ).to match_array ["Contraband", "The Godfather"]
    end
  end

  context "Find" do
    before do
      response = File.new(File.dirname(__FILE__) + '/fixtures/json/session.json')
      stub_request(:get, /.*planetargon.com.*/).to_return { |request| { :body => response } }
    end

    it "should return a hash" do
      expect(@client.sessions.find(429)).to be_an_instance_of(Hash)
    end
  end
end<commit_msg>Added more specs for singular session.<commit_after>require 'spec_helper'

describe "Sessions API Resource" do
  before do
    Veezi.configure do |config|
      config.api_key = "1234567890"
      config.endpoint_url = "http://planetargon.com"
    end

    @client = Veezi.client
  end

  context "All" do
    before do
      response = File.new(File.dirname(__FILE__) + '/fixtures/json/sessions.json')
      stub_request(:get, /.*planetargon.com.*/).to_return { |request| { :body => response } }
    end

    it "should return an array" do
      expect(@client.sessions.all).to be_an_instance_of(Array)
    end

    it "should have two films" do
      expect(@client.sessions.all.size).to eq 2
    end

    it "should have Contraband and The Godfather as the film time title names" do
      expect(@client.sessions.all.map { |movie| movie["Title"] } ).to match_array ["Contraband", "The Godfather"]
    end
  end

  context "Find" do
    before do
      response = File.new(File.dirname(__FILE__) + '/fixtures/json/session.json')
      stub_request(:get, /.*planetargon.com.*/).to_return { |request| { :body => response } }
    end

    it "should return a hash" do
      expect(@client.sessions.find(429)).to be_an_instance_of(Hash)
    end

    it "should have Women on the 6th Floor as the movie title" do
      expect(@client.sessions.find(429)["Title"]).to eq "Women on the 6th Floor"
    end

    it "should have a screen id of 1" do
      expect(@client.sessions.find(429)["ScreenId"]).to eq 1
    end
  end
end
{'fraction_non_alphanumeric': 0.12345229424617625, 'fraction_numerical': 0.013838310269482883, 'mean_word_length': 2.9985443959243088, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7428924', 'n_tokens_mistral': 945, 'n_tokens_neox': 894, 'n_words': 242}