<commit_before>require 'spec_helper'
require 'support/dummy_app'
require 'support/matchers/have_text'

app = DummyApp.new(ENV["RAILS_ENV"])
spec_types = {
  view: ["/posts/1", "PostsController"],
  mailer: ["/posts/1/mail", "PostMailer"]
}

app.start_server do
  spec_types.each do |type, (path, controller)|
    page = app.get(path)

    describe "in a #{type}" do
      it "runs in the correct environment" do
        expect(page).to have_text(app.environment).in("#environment")
      end

      it "uses the correct view context controller" do
        expect(page).to have_text(controller).in("#controller")
      end

      it "can use built-in helpers" do
        expect(page).to have_text("Once upon a...").in("#truncated")
      end

      it "can use built-in private helpers" do
        # Nokogiri unescapes text!
        expect(page).to have_text("<script>danger</script>").in("#html_escaped")
      end
<commit_msg>update integration spec for RSpec 3.0 syntax<commit_after>require 'spec_helper'
require 'support/dummy_app'
require 'support/matchers/have_text'

app = DummyApp.new(ENV["RAILS_ENV"])
spec_types = {
  view: ["/posts/1", "PostsController"],
  mailer: ["/posts/1/mail", "PostMailer"]
}

app.start_server do
  spec_types.each do |type, (path, controller)|
    page = app.get(path)

    RSpec.describe "in a #{type}" do
      it "runs in the correct environment" do
        expect(page).to have_text(app.environment).in("#environment")
      end

      it "uses the correct view context controller" do
        expect(page).to have_text(controller).in("#controller")
      end

      it "can use built-in helpers" do
        expect(page).to have_text("Once upon a...").in("#truncated")
      end

      it "can use built-in private helpers" do
        # Nokogiri unescapes text!
        expect(page).to have_text("<script>danger</script>").in("#html_escaped")
      end

{'fraction_non_alphanumeric': 0.13960867265996826, 'fraction_numerical': 0.0031729243786356425, 'mean_word_length': 3.3097949886104785, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3294843', 'n_tokens_mistral': 623, 'n_tokens_neox': 602, 'n_words': 154}