<commit_before>require 'spec_helper'

# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator.  If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
# It only uses APIs available in rails and/or rspec-rails.  There are a number
# of tools you can use to make these specs even more expressive, but we're
# sticking to rails and rspec-rails APIs to keep things simple and stable.
#
# Compared to earlier versions of this generator, there is very limited use of
# stubs and message expectations in this spec.  Stubs are only used when there
# is no simpler way to get a handle on the object needed for the example.
# Message expectations are only used when there is no simpler way to specify
# that an instance is receiving a specific message.

describe FormOfWorksController do
  login_admin
  fixtures :library_groups

  # This should return the minimal set of attributes required to create a valid
  # FormOfWork. As you add validations to FormOfWork, be sure to
  # update the return value of this method accordingly.
  def valid_attributes
    FactoryGirl.attributes_for(:form_of_work)
  end

  describe "GET index" do
<<<<<<< HEAD
    before(:each) do
      FactoryGirl.create(:form_of_work)
    end

    describe "When logged in as Administrator" do
      login_admin

      it "assigns all form_of_works as @form_of_works" do
        get :index
        assigns(:form_of_works).should eq(FormOfWork.all)
      end
    end

    describe "When logged in as Librarian" do
      login_librarian

      it "assigns all form_of_works as @form_of_works" do
        get :index
        assigns(:form_of_works).should eq(FormOfWork.all)
      end
    end

    describe "When logged in as User" do
      login_user

      it "assigns all form_of_works as @form_of_works" do
        get :index
        assigns(:form_of_works).should eq(FormOfWork.all)
      end
    end

    describe "When not logged in" do
      it "assigns all form_of_works as @form_of_works" do
        get :index
        assigns(:form_of_works).should eq(FormOfWork.all)
      end
=======
    it "assigns all form_of_works as @form_of_works" do
      form_of_work = FormOfWork.create! valid_attributes
      get :index
      assigns(:form_of_works).should eq(FormOfWork.page(1))
>>>>>>> 176c69d... allowed creating form_of_work
    end
  end

  describe "GET show" do
    it "assigns the requested form_of_work as @form_of_work" do
      form_of_work = FormOfWork.create! valid_attributes
      get :show, :id => form_of_work.id
      assigns(:form_of_work).should eq(form_of_work)
    end
  end

  describe "GET new" do
    it "assigns a new form_of_work as @form_of_work" do
      get :new
      assigns(:form_of_work).should be_a_new(FormOfWork)
    end
  end

  describe "GET edit" do
    it "assigns the requested form_of_work as @form_of_work" do
      form_of_work = FormOfWork.create! valid_attributes
      get :edit, :id => form_of_work.id
      assigns(:form_of_work).should eq(form_of_work)
    end
  end

  describe "POST create" do
    describe "with valid params" do<commit_msg>fixed spec file<commit_after>require 'spec_helper'

# This spec was generated by rspec-rails when you ran the scaffold generator.
# It demonstrates how one might use RSpec to specify the controller code that
# was generated by Rails when you ran the scaffold generator.
#
# It assumes that the implementation code is generated by the rails scaffold
# generator.  If you are using any extension libraries to generate different
# controller code, this generated spec may or may not pass.
#
# It only uses APIs available in rails and/or rspec-rails.  There are a number
# of tools you can use to make these specs even more expressive, but we're
# sticking to rails and rspec-rails APIs to keep things simple and stable.
#
# Compared to earlier versions of this generator, there is very limited use of
# stubs and message expectations in this spec.  Stubs are only used when there
# is no simpler way to get a handle on the object needed for the example.
# Message expectations are only used when there is no simpler way to specify
# that an instance is receiving a specific message.

describe FormOfWorksController do
  login_admin
  fixtures :library_groups

  # This should return the minimal set of attributes required to create a valid
  # FormOfWork. As you add validations to FormOfWork, be sure to
  # update the return value of this method accordingly.
  def valid_attributes
    FactoryGirl.attributes_for(:form_of_work)
  end

  describe "GET index" do
    it "assigns all form_of_works as @form_of_works" do
      form_of_work = FormOfWork.create! valid_attributes
      get :index
      assigns(:form_of_works).should eq(FormOfWork.all)
    end
  end

  describe "GET show" do
    it "assigns the requested form_of_work as @form_of_work" do
      form_of_work = FormOfWork.create! valid_attributes
      get :show, :id => form_of_work.id
      assigns(:form_of_work).should eq(form_of_work)
    end
  end

  describe "GET new" do
    it "assigns a new form_of_work as @form_of_work" do
      get :new
      assigns(:form_of_work).should be_a_new(FormOfWork)
    end
  end

  describe "GET edit" do
    it "assigns the requested form_of_work as @form_of_work" do
      form_of_work = FormOfWork.create! valid_attributes
      get :edit, :id => form_of_work.id
      assigns(:form_of_work).should eq(form_of_work)
    end
  end

  describe "POST create" do
    describe "with valid params" do
{'fraction_non_alphanumeric': 0.056910569105691054, 'fraction_numerical': 0.0010378827192527244, 'mean_word_length': 3.464864864864865, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 14, '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': '6195790', 'n_tokens_mistral': 1745, 'n_tokens_neox': 1669, 'n_words': 701}