<commit_before>require 'spec_helper'

describe Sandbox, :type => :model do
  attr_reader :question, :repository, :user_1, :user_2, :answer_1, :answer_2

  before do
    set_current_user(User.make!)
    @user_1 = User.make!
    @user_2 = User.make!
    @question = Question.make!
    @answer_1 = question.answers.make!(:creator => user_1)
    @answer_2 = question.answers.make!(:creator => user_2)
    @repository = Sandbox.new(current_user)
  end

  it "correctly interprets a join from answers on a given question to their users" do
    wire_reps = [
      {"type" => "InnerJoin",
       "leftOperand" =>
        {"type" => "Selection",
         "operand" => {"type" => "Table", "name" => "answers"},
         "predicate" =>
          {"type" => "Equal",<commit_msg>Fix sandbox spec for new permissions<commit_after>require 'spec_helper'

describe Sandbox, :type => :model do
  attr_reader :group, :question, :repository, :user_1, :user_2, :answer_1, :answer_2

  before do
    set_current_user(User.make!)
    @group = Group.make!
    @user_1 = User.make!
    @user_2 = User.make!

    group.add_member(current_user)
    group.add_member(user_1)
    group.add_member(user_2)

    @question = group.questions.make!
    @answer_1 = question.answers.make!(:creator => user_1)
    @answer_2 = question.answers.make!(:creator => user_2)
    @repository = Sandbox.new(current_user)
  end

  it "correctly interprets a join from answers on a given question to their users" do
    wire_reps = [
      {"type" => "InnerJoin",
       "leftOperand" =>
        {"type" => "Selection",
         "operand" => {"type" => "Table", "name" => "answers"},
         "predicate" =>
          {"type" => "Equal",
{'fraction_non_alphanumeric': 0.14893617021276595, 'fraction_numerical': 0.013002364066193853, 'mean_word_length': 3.275252525252525, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 25, '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': '3073236', 'n_tokens_mistral': 588, 'n_tokens_neox': 572, 'n_words': 132}