expected result to have changed by 1, but was changed by 0
<p>I'm new to RSpec and this error is all new to me. Everything seems routine so I can't seem to debug this issue myself. ERROR: expected result to have changed by 1, but was changed by 0. I'll post my code for clarity.</p>

<p>SUBSCRIBER FACTORY:</p>

<pre><code>FactoryGirl.define do
factory :subscriber do
 first_name "Tyler"
 last_name "Durden"
 email "tyler@example.com"
 phone_number "8765555"
end
end
</code></pre>

<p>CONTROLLER: </p>

<pre><code> class CommentsController &lt; ApplicationController
 def new
  @comment = Comment.new
 end

 def create
  @subscriber = Subscriber.order('updated_at desc').first
  @comment = @subscriber.comments.build(comments_params)
 if @comment.save
  flash[:notice] = "Thank you!"
  redirect_to subscribers_search_path(:comments)
 else
  render "new"
 end
end

private

def comments_params
 params.require(:comment).permit(:fav_drink, :subscriber_id)
end
end
</code></pre>

<p>SPEC:</p>

<pre><code>require "rails_helper"

describe SubscribersController do
include Devise::TestHelpers

let(:user) { FactoryGirl.create(:user) }
let(:subscriber) { FactoryGirl.attributes_for(:subscriber) }

it "creates a new comment" do
  sign_in(user)
  comment = FactoryGirl.attributes_for(:comment)

  expect { post :create, subscriber: subscriber, comment: comment }.to change{ Comment.count }.by(1)
end
end
</code></pre>

<p>ERROR:</p>

<pre><code>  Failure/Error: expect { post :create, subscriber: subscriber, comment: comment }.to change{ Comment.count }.by(1)
   expected result to have changed by 1, but was changed by 0
 # ./spec/controllers/comment_spec.rb:13:in `block (2 levels) in &lt;top (required)&gt;'
</code></pre>