<commit_before>require 'spec_helper'

describe Forem::Subscription do
  describe "topic subscriptions" do
    before(:each) do
      Forem::Topic.any_instance.stub(:set_first_post_user)
      attr = {
        :subject => "A topic",
        :user_id => Factory.create(:user).id
      }
      @topic = Forem::Topic.create!(attr)
    end
    
    it "creates a subscription when a topic is created" do
      @topic.subscriptions.count.should == 1
    end
    
    it "adds the topic subscriber to the subscription" do
      @topic.subscriptions.first.subscriber.should == @topic.user
    end
  end
end
<commit_msg>Stub out all calls to user in topic model spec<commit_after>require 'spec_helper'

describe Forem::Subscription do
  describe "topic subscriptions" do
    before(:each) do
      Forem::Topic.any_instance.stub(:set_first_post_user)
      Forem::Topic.any_instance.stub(:user).and_return(User)
      attr = {
        :subject => "A topic",
      }
      @topic = Forem::Topic.create!(attr)
    end

    it "creates a subscription when a topic is created" do
      @topic.subscriptions.count.should == 1
    end

    it "adds the topic subscriber to the subscription" do
      @topic.subscriptions.first.subscriber.should == @topic.user
    end
  end
end

{'fraction_non_alphanumeric': 0.10134600158353127, 'fraction_numerical': 0.001583531274742676, 'mean_word_length': 2.9623824451410656, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1664418', 'n_tokens_mistral': 389, 'n_tokens_neox': 386, 'n_words': 104}