<commit_before>require 'spec_helper'

describe WorkElementTypesController do

  render_views

  before :each do
    #@user = login_as_admin
    @request.env["devise.mapping"] = Devise.mappings[:user]
    @user = FactoryGirl.create(:authenticated_user)
    sign_in @user
    @app_auth_method = FactoryGirl.build(:application_auth_method)

    @ability = Object.new
    @ability.extend(CanCan::Ability)
    controller.stub(:current_ability) { @ability }

    @wet = FactoryGirl.create(:work_element_type, :wet_folder)
  end

  describe "GET 'index'" do
    it "returns http success" do
      @ability.can :read, WorkElementType
      get "index", :format => "html"
      response.should render_template("index")
    end
  end

  describe "New" do
    it "renders the new template" do
      @ability.can :read, WorkElementType
      get :new
      #response.should render_template("new")
      expect(:get => "/work_element_types/new").to route_to(:controller => "work_element_types", :action => "new")
    end
  end

  describe "Edit" do
    it "renders the new template" do
      @ability.can :update, WorkElementType

      @wet = FactoryGirl.create(:work_element_type, :wet_folder)
      get :edit, {:id => @wet.id}
      response.should render_template("edit")
    end
  end

end
<commit_msg>Enhance quick search.: refs  #284<commit_after>require 'spec_helper'

describe WorkElementTypesController do

  render_views

  before :each do
    #@user = login_as_admin
    @user = FactoryGirl.create(:authenticated_user)
    sign_in @user
    @app_auth_method = FactoryGirl.build(:application_auth_method)

    @ability = Object.new
    @ability.extend(CanCan::Ability)
    controller.stub(:current_ability) { @ability }

    @wet = FactoryGirl.create(:work_element_type, :wet_folder)
  end

  describe "GET 'index'" do
    it "returns http success" do
      @ability.can :read, WorkElementType
      get "index", :format => "html"
      response.should render_template("index")
    end
  end

  describe "New" do
    it "renders the new template" do
      @ability.can :read, WorkElementType
      get :new
      #response.should render_template("new")
      expect(:get => "/work_element_types/new").to route_to(:controller => "work_element_types", :action => "new")
    end
  end

  describe "Edit" do
    it "renders the new template" do
      @ability.can :update, WorkElementType

      @wet = FactoryGirl.create(:work_element_type, :wet_folder)
      get :edit, {:id => @wet.id}
      response.should render_template("edit")
    end
  end

end

{'fraction_non_alphanumeric': 0.11342229199372056, 'fraction_numerical': 0.0011773940345368916, 'mean_word_length': 3.511504424778761, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '1787050', 'n_tokens_mistral': 830, 'n_tokens_neox': 799, 'n_words': 194}