# frozen_string_literal: true

require 'spec_helper'

describe UsersController, type: :controller do
  fixtures :users
  let(:user) { FactoryBot.create(:user) }
  # TODO: Shouldn't need a conference to render
  before do
    FactoryBot.create(:conference)
  end

  context 'with views' do
    before do
      controller.view.stubs(:previous_sessions).returns([])
    end
    render_views
    it 'show should work' do
      get :show, id: user.id
    end
  end

  describe '#index' do
    describe 'with json format' do
      before do
        xhr :get, :index, format: :json, term: 'dt'
      end

      subject { response }

      its(:content_type) { should == 'application/json' }
    end
  end

  describe '#show' do
    before do
      get :show, id: user.id
    end

    it { should respond_with(:success) }
    it { should render_template(:show) }
  end
end

# frozen_string_literal: true

require 'spec_helper'

describe UsersController, type: :controller do
  fixtures :users
  let(:user) { FactoryBot.create(:user) }
  # TODO: Shouldn't need a conference to render
  before do
    FactoryBot.create(:conference)
  end

  describe '#index' do
    describe 'with json format' do
      before do
        xhr :get, :index, format: :json, term: 'dt'
      end

      subject { response }

      its(:content_type) { should == 'application/json' }
    end
  end

  describe '#show' do
    before do
      get :show, id: user.id
    end

    it { should respond_with(:success) }
    it { should render_template(:show) }
  end
end

Remove test. It's not helping
Remove test. It's not helping
