<commit_before>require "test_helper"

=begin

  What's being tested here?

    - Scopes

=end

class Admin::PagesControllerTest < ActionController::TestCase

  setup do
    @typus_user = Factory(:typus_user)
    @request.session[:typus_user_id] = @typus_user.id
  end

  teardown do
    Page.delete_all
    TypusUser.delete_all
  end

  context "index" do

    setup do
      Factory(:page)
      Factory(:page, :status => false)
    end

    should "return scoped results" do
      assert Page.count.eql?(1)
      get :index
      assert assigns(:items).size.eql?(1)
    end
  end

end<commit_msg>I do want to mantain less code<commit_after>require "test_helper"

=begin

  What's being tested here?

    - Scopes

  Hey! I do not recommend setting a default_scope because you'll probably get
  unexpected results. This is here for testing purposes, but please, avoid
  using this kind of stuff.

=end

class Admin::PagesControllerTest < ActionController::TestCase

  setup do
    @typus_user = Factory(:typus_user)
    @request.session[:typus_user_id] = @typus_user.id

    Factory(:page)
    Factory(:page, :status => false)
  end

  teardown do
    Page.delete_all
    TypusUser.delete_all
  end

  test "get :index returns scoped results" do
    get :index
    assert_equal Page.all, assigns(:items)
  end

end
{'fraction_non_alphanumeric': 0.08593155893536121, 'fraction_numerical': 0.001520912547528517, 'mean_word_length': 3.272727272727273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3221267', 'n_tokens_mistral': 438, 'n_tokens_neox': 421, 'n_words': 123}