Created
April 19, 2014 01:44
-
-
Save pacuna/11071201 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe 'POST #create' do | |
it "saves the post to the db" do | |
expect{ | |
post :create, :post => {:title => "The title", :body => "The Body"} | |
}.to change(Post, :count).by(1) | |
end | |
it "redirects to @post" do | |
@post = {:title => 'The title', :body => 'The body'} | |
post :create, :post => @post | |
expect(response).to redirect_to '/posts/1' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment