<commit_before>require 'spec_helper'

describe UserObserver do

  describe "after_create" do
    before do
      UserObserver.any_instance.should_receive(:after_create).and_call_original
      Notification.unstub(:notify_once)
    end

    let(:user) { create(:user, newsletter: false) }

    it "send new user registration notification" do
      Notification.should_receive(:notify_once).with(:new_user_registration, user, {user_id: user.id}, {user: user})
    end

    it 'should set the newsletter to true' do
      expect(user.newsletter).to be_true
    end
  end

  context 'before_save' do
    subject { create(:user, twitter: '@should_be_change') }

    its(:twitter) { should == '<PASSWORD>' }
  end
end<commit_msg>Fix spec user observer<commit_after>require 'spec_helper'

describe UserObserver do

  describe "after_create" do
    before do
      UserObserver.any_instance.should_receive(:after_create).and_call_original
      Notification.unstub(:notify_once)
    end

    let(:user) { create(:user, newsletter: false) }

    it "send new user registration notification" do
      Notification.should_receive(:notify_once).with(:new_user_registration, user, {user_id: user.id}, {user: user})
    end

    it 'should set the newsletter to true' do
      expect(user.newsletter).to be_true
    end
  end

end
{'fraction_non_alphanumeric': 0.0980243161094225, 'fraction_numerical': 0.0, 'mean_word_length': 3.969811320754717, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '349587', 'n_tokens_mistral': 412, 'n_tokens_neox': 386, 'n_words': 101}