<commit_before>require 'spec_helper'

describe Monologue::Admin::PostsController do
  let(:user) { create(:user) }
  before do
    sign_in_as user
    # before(:each) { @routes = Monologue::Engine.routes }
    @routes = Monologue::Engine.routes
  end

  describe 'PUT #update' do
    let(:post) { create(:post) }
    let(:new_content) { 'This is the new content, for real!' }
    let(:new_title) { 'nothing to do, I find it awesome!' }

    context :valid do
      before do
        put :update,
          id: post.id,
          post: {
            content: new_content,
            title: new_title
          }
      end

      it { expect(post.reload.content).to eq new_content }
      it { expect(post.reload.title).to eq new_title }
    end

    # context :invalid do
    #   before do
    #   end
    # end
  end
end<commit_msg>some small changes to posts_controller_spec<commit_after>require 'spec_helper'

describe Monologue::Admin::PostsController do
  let(:user) { create(:user) }
  before do
    sign_in_as user
    @routes = Monologue::Engine.routes
  end

  describe 'PUT #update' do
    let(:post) { create(:post) }
    let(:new_content) { 'This is the new content, for real!' }
    let(:new_title) { 'nothing to do, I find it awesome!' }

    context :valid do
      before do
        put :update,
          id: post.id,
          post: {
            content: new_content,
            title: new_title
          }
        post.reload
      end

      it { expect(post.content).to eq new_content }
      it { expect(post.title).to eq new_title }
    end

    # context :invalid do
    #   before do
    #   end
    # end
  end
end
{'fraction_non_alphanumeric': 0.10590383444917834, 'fraction_numerical': 0.0, 'mean_word_length': 2.2046783625730995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1561075', 'n_tokens_mistral': 527, 'n_tokens_neox': 518, 'n_words': 145}