<commit_before>require 'test_helper'

class Admin::EditionsControllerAuthenticationTest < ActionController::TestCase
  tests Admin::EditionsController

  test 'guests should not be able to access index' do
    get :index

    assert_login_required
  end

  test 'guests should not be able to access published' do
    get :published

    assert_login_required
  end

  test 'guests should not be able to access submitted' do
    get :submitted

    assert_login_required
  end

  test 'guests should not be able to access new' do
    get :new

    assert_login_required
  end

  test 'guests should not be able to access create' do
    post :create, edition: attributes_for(:edition)

    assert_login_required
  end

  test 'guests should not be able to access edit' do
    edition = create(:edition)

    get :edit, id: edition.to_param

    assert_login_required
  end

  test 'guests should not be able to access update' do
    edition = create(:edition)
    post :update, id: edition.to_param, edition: attributes_for(:edition)

    assert_login_required
  end<commit_msg>Consistently use HTTP PUT to test Admin::EditionsController#update.<commit_after>require 'test_helper'

class Admin::EditionsControllerAuthenticationTest < ActionController::TestCase
  tests Admin::EditionsController

  test 'guests should not be able to access index' do
    get :index

    assert_login_required
  end

  test 'guests should not be able to access published' do
    get :published

    assert_login_required
  end

  test 'guests should not be able to access submitted' do
    get :submitted

    assert_login_required
  end

  test 'guests should not be able to access new' do
    get :new

    assert_login_required
  end

  test 'guests should not be able to access create' do
    post :create, edition: attributes_for(:edition)

    assert_login_required
  end

  test 'guests should not be able to access edit' do
    edition = create(:edition)

    get :edit, id: edition.to_param

    assert_login_required
  end

  test 'guests should not be able to access update' do
    edition = create(:edition)
    put :update, id: edition.to_param, edition: attributes_for(:edition)

    assert_login_required
  end
{'fraction_non_alphanumeric': 0.053514739229024944, 'fraction_numerical': 0.0, 'mean_word_length': 3.6936170212765957, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '1556169', 'n_tokens_mistral': 650, 'n_tokens_neox': 628, 'n_words': 239}