title: What is the proper way to test 'create' controller actions?
body: <p>I am using Ruby on Rails 3.2.2, Rspec 2.9.0 and RspecRails 2.9.0. I would like to test the <code>create</code> controller action but I don't know how to make that the "right"/"proper" way. I "scaffolded" model, controller, view, ... files, so in those files I have the common code generated by Ruby on Rails generators; in my spec file I have:</p>
  
  <pre><code>it "assigns @article" do
    new_article = FactoryGirl.build(:article)
    Article.should_receive(:new).and_return(new_article)
    post :create
    assigns[:article].should eq(new_article)
  end
  </code></pre>
  
  <p>Maybe, (<em>note</em>: the above code is almost the same as that I use to test the <code>new</code> controller action) <em>a better way to test <code>create</code> controller actions would be to pass some attribute value during the <code>post :create</code> action instead of proceed as I make above</em>, but I don't know how to make that and if it is the "right"/"proper" way to make things.</p>
  
  <p>So, <strong>what is the proper way to test 'create' controller actions?</strong></p>