<commit_before>require 'spec_helper'

describe 'explain' do

  before :each do
    @current_user = create(:user, uid: 'm2604100', provider: 'mxit')
    set_mxit_headers('m2604100') # set mxit user
    stub_shinka_request # stub shinka request
    stub_google_tracking # stub google tracking
    stub_mxit_oauth :user_id => "m2604100"
                                 # stub out uservoice
    stub_request(:post, "https://#{ENV['UV_SUBDOMAIN_NAME']}.uservoice.com/api/v1/tickets.json").
      to_return(:status => 200, :body => "{}")
    stub_request(:get, "https://#{ENV['UV_SUBDOMAIN_NAME']}.uservoice.com/api/v1/forums.json").
      to_return(:status => 200, :body => "{\"forums\":[{\"id\":123}]}")
    stub_request(:post, "https://#{ENV['UV_SUBDOMAIN_NAME']}.uservoice.com/oauth/request_token").
      to_return(:status => 200, :body => "{}")
    stub_request(:post, "https://#{ENV['UV_SUBDOMAIN_NAME']}.uservoice.com/api/v1/users/login_as.json").
      to_return(:status => 200, :body => "{\"token\":{\"oauth_token\":123, \"oauth_token_secret\":123}}")
    stub_request(:post, "https://.uservoice.com/api/v1/forums/123/suggestions.json").
      to_return(:status => 200, :body => "{}")
  end

  it "must allow to browse explain section" do
    visit '/'
    click_link('rank')
    click_link('scoring')
    click_link('score')
    click_link('scoring')
    click_link('rating')
    click_link('scoring')
    click_link('precision')
    click_link('scoring')
    click_link('winning_streak')
    click_link('scoring')
    click_link('payouts')
    click_link('home')
  end

end<commit_msg>fix explain spec because score removed<commit_after>require 'spec_helper'

describe 'explain' do

  before :each do
    @current_user = create(:user, uid: 'm2604100', provider: 'mxit')
    set_mxit_headers('m2604100') # set mxit user
    stub_shinka_request # stub shinka request
    stub_google_tracking # stub google tracking
    stub_mxit_oauth :user_id => "m2604100"
                                 # stub out uservoice
    stub_request(:post, "https://#{ENV['UV_SUBDOMAIN_NAME']}.uservoice.com/api/v1/tickets.json").
      to_return(:status => 200, :body => "{}")
    stub_request(:get, "https://#{ENV['UV_SUBDOMAIN_NAME']}.uservoice.com/api/v1/forums.json").
      to_return(:status => 200, :body => "{\"forums\":[{\"id\":123}]}")
    stub_request(:post, "https://#{ENV['UV_SUBDOMAIN_NAME']}.uservoice.com/oauth/request_token").
      to_return(:status => 200, :body => "{}")
    stub_request(:post, "https://#{ENV['UV_SUBDOMAIN_NAME']}.uservoice.com/api/v1/users/login_as.json").
      to_return(:status => 200, :body => "{\"token\":{\"oauth_token\":123, \"oauth_token_secret\":123}}")
    stub_request(:post, "https://.uservoice.com/api/v1/forums/123/suggestions.json").
      to_return(:status => 200, :body => "{}")
  end

  it "must allow to browse explain section" do
    visit '/'
    click_link('rank')
    click_link('scoring')
    click_link('rating')
    click_link('scoring')
    click_link('precision')
    click_link('scoring')
    click_link('winning_streak')
    click_link('scoring')
    click_link('payouts')
    click_link('home')
  end

end
{'fraction_non_alphanumeric': 0.1829692940804052, 'fraction_numerical': 0.03292181069958848, 'mean_word_length': 3.8615384615384616, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 25, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '494204', 'n_tokens_mistral': 1197, 'n_tokens_neox': 1154, 'n_words': 170}