<commit_before>require 'spec_helper'

describe EmbedsController, controllers: true, debug:true do
                   # search_embeds GET      /embeds/search(.:format)                                             embeds#search
                   #        embeds GET      /embeds(.:format)                                                    embeds#index
                   #               POST     /embeds(.:format)                                                    embeds#create
                   #     new_embed GET      /embeds/new(.:format)                                                embeds#new
                   #    edit_embed GET      /embeds/:id/edit(.:format)                                           embeds#edit
                   #         embed GET      /embeds/:id(.:format)                                                embeds#show
                   #               PUT      /embeds/:id(.:format)                                                embeds#update
                   #               DELETE   /embeds/:id(.:format)                                                embeds#destroy
	before do
		@user = Factory(:user_vish)
	end
	
  	it 'embeds edit' do 
    	get :edit
  	end   
  	it 'embeds create' do
  		sign_in @user
  		get :create
  		assert_response(action(:new))
  	end

  	it 'embeds show' do 
    	get :show
  	end

  	it 'embeds update' do
  		sign_in @user 
    	get :update
  	end   
  	it 'embeds destroy' do 
    	get :destroy
  	end   
  		
end<commit_msg>Embed tests<commit_after>require 'spec_helper'

describe EmbedsController, controllers: true, debug:true do
                   # search_embeds GET      /embeds/search(.:format)                                             embeds#search
                   #        embeds GET      /embeds(.:format)                                                    embeds#index
                   #               POST     /embeds(.:format)                                                    embeds#create
                   #     new_embed GET      /embeds/new(.:format)                                                embeds#new
                   #    edit_embed GET      /embeds/:id/edit(.:format)                                           embeds#edit
                   #         embed GET      /embeds/:id(.:format)                                                embeds#show
                   #               PUT      /embeds/:id(.:format)                                                embeds#update
                   #               DELETE   /embeds/:id(.:format)                                                embeds#destroy
    before do
  		@user = Factory(:user_vish)
  	  @embed = Factory(:embed, author: @user.actor, owner: @user.actor )
    end
	
  	it 'embeds edit' do 
    	get :edit
  	end   
  	
     it 'embeds create with json' do
      sign_in @user
      get :create, :embed => { owner_id: @user.actor.id, title: "asdfsdas", description: "adsfasda", tag_list: [], language: "independent", age_min: 0, age_max: 0, scope: 0 }
      binding.pry
      response.should redirect_to(Embed.last)
    end

  	it 'embeds show' do 
    	get :show, {id: @embed.id}
      assert_response :success
  	end

  	it 'embeds update' do
  		sign_in @user 
    	put :update, :embed => { owner_id: @user.actor.id, title: "asdfsdas", description: "adsfasda", tag_list: [], language: "independent", age_min: 0, age_max: 0, scope: 0 }, :id => @embed.id
      response.should redirect_to(@embed)
  	end

  	it 'embeds destroy' do 
    	get :destroy
  	end   
  		
end
{'fraction_non_alphanumeric': 0.0846262341325811, 'fraction_numerical': 0.001692524682651622, 'mean_word_length': 0.9843312814773363, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 40, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1549523', 'n_tokens_mistral': 938, 'n_tokens_neox': 889, 'n_words': 216}