how to expect 'render template' error
<p>I have a view template "show.html.haml", something like </p>

<pre><code>- if current_user.admin?
  balabala
</code></pre>

<p>It will get "undefined method `admin?' for nil:NilClass" while GET #show. I fixed it with " - if !current_user.nil? &amp;&amp; current_user.admin?". And I want to add a test case with RSpec.</p>

<pre><code>describe "before login user - " do

  it "render the show template" do
    book = FactoryGirl.create(:book)
    get :show, id: book.id

    expect(response).to render_template("show")
    expect(response).to be_success
  end
end
</code></pre>

<p>While run "bin/rake spec", it always get success no matter if I add the condition "!current_user.nil?". How can I write the expect clause while I want to check if rendering 'show' view is sucess?</p>