Skip to content

Instantly share code, notes, and snippets.

@kazumalab
Last active August 20, 2017 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazumalab/f36a90ad441fecce486bc5a8b93ac763 to your computer and use it in GitHub Desktop.
Save kazumalab/f36a90ad441fecce486bc5a8b93ac763 to your computer and use it in GitHub Desktop.
ApplicationController.current_userをモックしてない場合(テストは失敗)
require 'rails_helper'
RSpec.describe "UserController", type: :request do
describe "#index" do
let(:user) { FactoryGirl.create(:user) }
context 'success' do
before do
get user_path user
end
it { expect(response).to render_template :show }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment