<commit_before>require 'spec_helper'

describe UsersController do

  describe "GET 'index'" do

    it "returns http success" do
      get 'index'
      response.should be_success
    end

    it "assigns all users" do
    	pending
    	get 'index'
    	# assigns(:users).should
    end
  end

  describe "GET 'show'" do
    before :each do
      #@user = double('User')
    	@user = double('User', id: 1,
                     first_name: 'Hermionie',
                     last_name: 'Granger',
                     email: '<EMAIL>',
                    )
      User.stub(find: @user)
    end
    it "assigns a user instance" do
  		get 'show', id: @user.id
  		expect(assigns(:user)).not_to be_nil
    end
    it "renders the show view" do
      get 'show', id: @user.id
      expect(response).to render_template :show
    end
  end

end
<commit_msg>added controller spec for followed projects<commit_after>require 'spec_helper'

describe UsersController do

  describe "GET 'index'" do

    it "returns http success" do
      get 'index'
      response.should be_success
    end

    it "assigns all users" do
    	pending
    	get 'index'
    	# assigns(:users).should
    end
  end

  describe "GET 'show'" do
    before :each do
      #@user = double('User')
    	@user = double('User', id: 1,
                     first_name: 'Hermionie',
                     last_name: 'Granger',
                     email: '<EMAIL>',
                    )
      User.stub(find: @user)
      @user.stub(folloing_by_type: @projects)
    end
    it "assigns a user instance" do
  		get 'show', id: @user.id
  		expect(assigns(:user)).not_to be_nil
    end
    it "renders the show view" do
      get 'show', id: @user.id
      expect(response).to render_template :show
    end

    context "with followed projects" do
      before :each do
        @projects = [
          mock_model(Project, friendly_id: 'title-1', title: 'Title 1'),
          mock_model(Project, friendly_id: 'title-2', title: 'Title 2'),
          mock_model(Project, friendly_id: 'title-3', title: 'Title 3')
        ]
      end

      it "assigns a list of project being followed" do
        get 'show', id: @user.id
        expect(assigns(:users_projects).to eq(@fake_projects))
      end
    end
  end

end

{'fraction_non_alphanumeric': 0.10700132100396301, 'fraction_numerical': 0.0035226772346983706, 'mean_word_length': 2.029333333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3094148', 'n_tokens_mistral': 731, 'n_tokens_neox': 708, 'n_words': 214}