<commit_before>require 'spec_helper'

describe PresentationsController do
  def mock_user(stubs={})
    @mock_user ||= mock_model(User, stubs).as_null_object
  end

  before(:each) do
    # mock up an authentication in the underlying warden library
    request.env['warden'] = mock(Warden, :authenticate => mock_user,
                                 :authenticate! => mock_user)
  end

  describe "GET 'new'" do
    it "should be successful and render all partials" do
      get 'new'
      response.should be_success
      response.should render_template("assets/new")
      assigns(:content).class.should == Presentation
    end
  end
end<commit_msg>add specs for presentations_controller<commit_after>require 'spec_helper'

describe PresentationsController do
  def mock_user(stubs={})
    @mock_user ||= mock_model(User, stubs).as_null_object
  end

  before(:each) do
    # mock up an authentication in the underlying warden library
    request.env['warden'] = mock(Warden, :authenticate => mock_user,
                                 :authenticate! => mock_user)
  end

  describe "GET 'new'" do
    it "should be successful and render all partials" do
      get 'new'
      response.should be_success
      response.should render_template("assets/new")
      assigns(:content).class.should == Presentation
    end
  end

  describe "GET 'show'" do
    let(:presentation) { double(Presentation, :id => 1) }

    before(:each) do
      my_p = presentation
      controller.stub!(:find_content) {}
      controller.instance_eval { @content = my_p }
    end

    it "should be successful and render partials" do
      get 'show', :id => presentation.id
      assigns(:presentation).should_not be_nil
      response.should be_success
      response.should render_template("layouts/slide")
      response.should render_template("presentations/show")
    end
  end

  describe "GET 'index'" do
    it "should be successful render all partials" do
      pending "not sure, what should happen here" #the next steps is, what actually happens, kind of
      get 'index'
      response.should redirect_to(root_path)
      request.flash[:error].should =~ /not found$/
    end
  end
end
{'fraction_non_alphanumeric': 0.0944954128440367, 'fraction_numerical': 0.00045871559633027525, 'mean_word_length': 3.1150943396226416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6640392', 'n_tokens_mistral': 635, 'n_tokens_neox': 615, 'n_words': 184}