<commit_before>require 'test_helper'

class ProjectsControllerTest < ActionController::TestCase
  include Devise::TestHelpers
  setup do
    sign_in create(:user)
  end

  test "get index" do
    get :index
    assert_response :success
  end

  test "get projects template" do
    get :angular

    assert_response :success
    assert_template 'projects/projects'
  end

  test 'artist project level has sharing meta tags' do
    get :edit, key: :artist

    assert_response :success
    assert_sharing_meta_tags(
      url: 'http://test.host/projects/artist',
      image: 'http://test.host/assets/sharing_drawing.png',
      image_width: 500,
      image_height: 261
    )
  end

  test 'applab project level has sharing meta tags' do
    get :edit, key: :applab

    assert_response :success
    assert_sharing_meta_tags(
      url: 'http://test.host/projects/applab',
      image: 'http://test.host/assets/sharing_drawing.png',
      image_width: 400,
      image_height: 400,
      apple_mobile_web_app: true
    )
  end

  test 'playlab project level has sharing meta tags' do
    get :edit, key: :playlab

    assert_response :success
    assert_sharing_meta_tags(
      url: 'http://test.host/projects/playlab',
      image: 'http://test.host/assets/sharing_drawing.png',
      image_width: 400,
      image_height: 400,
      apple_mobile_web_app: true
    )
  end
end<commit_msg>add test for projects controller send to phone<commit_after>require 'test_helper'

class ProjectsControllerTest < ActionController::TestCase
  include Devise::TestHelpers
  setup do
    sign_in create(:user)
  end

  test "get index" do
    get :index
    assert_response :success
  end

  test "get projects template" do
    get :angular

    assert_response :success
    assert_template 'projects/projects'
  end

  test 'artist project level has sharing meta tags' do
    get :edit, key: :artist

    assert_response :success
    assert_sharing_meta_tags(
      url: 'http://test.host/projects/artist',
      image: 'http://test.host/assets/sharing_drawing.png',
      image_width: 500,
      image_height: 261
    )
  end

  test 'applab project level has sharing meta tags' do
    get :edit, key: :applab

    assert_response :success
    assert_sharing_meta_tags(
      url: 'http://test.host/projects/applab',
      image: 'http://test.host/assets/sharing_drawing.png',
      image_width: 400,
      image_height: 400,
      apple_mobile_web_app: true
    )
  end

  test 'playlab project level has sharing meta tags' do
    get :edit, key: :playlab

    assert_response :success
    assert_sharing_meta_tags(
      url: 'http://test.host/projects/playlab',
      image: 'http://test.host/assets/sharing_drawing.png',
      image_width: 400,
      image_height: 400,
      apple_mobile_web_app: true
    )
  end

  test 'send to phone' do
    get :edit, key: :playlab
    assert @response.body.include? '"send_to_phone_url":"http://test.host/sms/send"'
  end
end
{'fraction_non_alphanumeric': 0.09364435429344152, 'fraction_numerical': 0.012170385395537525, 'mean_word_length': 3.0813793103448277, 'pattern_counts': {'":': 1, '<': 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': '4328702', 'n_tokens_mistral': 995, 'n_tokens_neox': 920, 'n_words': 245}