<commit_before>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Package voting" do

  include WebratHelpers
  include AuthHelper

  setup do
    Version.make
    UserMailer.should_receive(:deliver_signup_notification)
    UserMailer.should_receive(:deliver_activation)
    User.make(:login => "john").activate
  end

  before(:each) do
    @user = User.first
    @user.package_votes.destroy_all
    @pkg = Package.first
    visit login_url
    login_with_valid_credentials
    visit package_url(@pkg)
  end

  it "should be possible to vote for a package" do
    click_button "Vote!"
    response.should have_tag("span", "1 vote")<commit_msg>Update wording to "uses" in vote spec<commit_after>require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe "Package voting" do

  include WebratHelpers
  include AuthHelper

  setup do
    Version.make
    UserMailer.should_receive(:deliver_signup_notification)
    UserMailer.should_receive(:deliver_activation)
    User.make(:login => "john").activate
  end

  before(:each) do
    @user = User.first
    @user.package_votes.destroy_all
    @pkg = Package.first
    visit login_url
    login_with_valid_credentials
    visit package_url(@pkg)
  end

  it "should be possible to vote for a package" do
    click_button "I use this!"
    response.should have_tag("span", "1 user")
{'fraction_non_alphanumeric': 0.09447674418604651, 'fraction_numerical': 0.0014534883720930232, 'mean_word_length': 3.9711191335740073, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5098803', 'n_tokens_mistral': 443, 'n_tokens_neox': 425, 'n_words': 103}