<commit_before>require File.expand_path('../../spec_helper.rb',  __FILE__)

describe PhonesController, :type => :controller do

  before(:all) do
    @phone = phones(:valid_and_possible)
    @phone.save
    Phonelib.default_country = nil
  end

  it 'should get index' do
    get :index
    if Rails::VERSION::MAJOR > 5
      expect(response).to have_http_status(:ok)
    else
      expect(response).to be_success
    end
    expect(assigns(:phones)).not_to be_nil
  end

  it 'should get new' do
    get :new
    if Rails::VERSION::MAJOR > 5
      expect(response).to have_http_status(:ok)
    else
      expect(response).to be_success
    end
  end

  it 'should create phone' do
    assert_difference(Phone, :count) do
      if Rails::VERSION::MAJOR > 4
        post :create, params: { phone: { number: @phone.number } }
      else
        post :create, phone: { number: @phone.number }
      end
    end

    expect(response).to redirect_to(phone_path(assigns(:phone)))
  end

  it 'should show phone' do
    if Rails::VERSION::MAJOR > 4
      get :show, params: { id: @phone }
    else
      get :show, id: @phone
    end
    expect(response).to have_http_status(:ok)
  end

  it 'should get edit' do
    if Rails::VERSION::MAJOR > 4
      get :edit, params: { id: @phone }
    else
      get :edit, id: @phone
    end
    if Rails::VERSION::MAJOR > 5
      expect(response).to have_http_status(:ok)
    else
      expect(response).to be_success
    end
  end

  it 'should update phone' do
    if Rails::VERSION::MAJOR > 4
      put :update, params: { id: @phone, phone: { number: @phone.number } }
    else
      put :update, id: @phone, phone: { number: @phone.number }
    end
    expect(response).to redirect_to(phone_path(assigns(:phone)))
  end

  it 'should destroy phone' do
    assert_difference(Phone, :count, -1) do
      if Rails::VERSION::MAJOR > 4
        delete :destroy, params: { id: @phone }
      else
        delete :destroy, id: @phone
      end
    end

    expect(response).to redirect_to(phones_path)
  end
end
<commit_msg>fixing tests again<commit_after>require File.expand_path('../../spec_helper.rb',  __FILE__)

describe PhonesController, :type => :controller do

  before(:all) do
    @phone = phones(:valid_and_possible)
    @phone.save
    Phonelib.default_country = nil
  end

  it 'should get index' do
    get :index
    if Rails::VERSION::MAJOR > 5
      expect(response).to have_http_status(:ok)
    else
      expect(response).to be_success
    end
    expect(assigns(:phones)).not_to be_nil
  end

  it 'should get new' do
    get :new
    if Rails::VERSION::MAJOR > 5
      expect(response).to have_http_status(:ok)
    else
      expect(response).to be_success
    end
  end

  it 'should create phone' do
    assert_difference(Phone, :count) do
      if Rails::VERSION::MAJOR > 4
        post :create, params: { phone: { number: @phone.number } }
      else
        post :create, phone: { number: @phone.number }
      end
    end

    expect(response).to redirect_to(phone_path(assigns(:phone)))
  end

  it 'should show phone' do
    if Rails::VERSION::MAJOR > 4
      get :show, params: { id: @phone }
    else
      get :show, id: @phone
    end
    if Rails::VERSION::MAJOR > 5
      expect(response).to have_http_status(:ok)
    else
      expect(response).to be_success
    end
  end

  it 'should get edit' do
    if Rails::VERSION::MAJOR > 4
      get :edit, params: { id: @phone }
    else
      get :edit, id: @phone
    end
    if Rails::VERSION::MAJOR > 5
      expect(response).to have_http_status(:ok)
    else
      expect(response).to be_success
    end
  end

  it 'should update phone' do
    if Rails::VERSION::MAJOR > 4
      put :update, params: { id: @phone, phone: { number: @phone.number } }
    else
      put :update, id: @phone, phone: { number: @phone.number }
    end
    expect(response).to redirect_to(phone_path(assigns(:phone)))
  end

  it 'should destroy phone' do
    assert_difference(Phone, :count, -1) do
      if Rails::VERSION::MAJOR > 4
        delete :destroy, params: { id: @phone }
      else
        delete :destroy, id: @phone
      end
    end

    expect(response).to redirect_to(phones_path)
  end
end

{'fraction_non_alphanumeric': 0.11619047619047619, 'fraction_numerical': 0.004523809523809524, 'mean_word_length': 2.6850877192982456, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, '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': '7585245', 'n_tokens_mistral': 1426, 'n_tokens_neox': 1365, 'n_words': 383}