<commit_before>require 'smoke_spec_helper.rb'
require 'uri'
require 'member_hasher'

include Rails.application.routes.url_helpers

describe 'Petition page' do
  before :each do
    @petition = create_a_petition
  end
  it 'should allow users to sign' do
    force_result({"after share view" => "modal"})<commit_msg>force creation of post-signing experiment keys for testing<commit_after>require 'smoke_spec_helper.rb'
require 'uri'
require 'member_hasher'

include Rails.application.routes.url_helpers

describe 'Petition page' do
  before :all do
    #we need to sign a petition to force creation of certain experiment keys in Redis ('after share view', for example)
    #this is sucky, so let's think of a better way
    petition = create :petition
    go_to petition_path(petition)
    sign_petition
  end

  before :each do
    @petition = create_a_petition
  end

  it 'should allow users to sign' do
    force_result({"after share view" => "modal"})
{'fraction_non_alphanumeric': 0.07853403141361257, 'fraction_numerical': 0.0, 'mean_word_length': 4.431818181818182, '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': '2738061', 'n_tokens_mistral': 298, 'n_tokens_neox': 283, 'n_words': 104}