Skip to content

Instantly share code, notes, and snippets.

@JunichiIto
Created January 19, 2016 06:15
Show Gist options
  • Save JunichiIto/a47e5b615ceb3b8698ec to your computer and use it in GitHub Desktop.
Save JunichiIto/a47e5b615ceb3b8698ec to your computer and use it in GitHub Desktop.
context '有効なパラメータの場合' do
before do
@user = attributes_for(:user)
end
it '正しく登録されること' do
expect{
post :create, user: @user
}.to change(User, :count).by(1)
expect(response.status).to eq 302
expect(response).to redirect_to root_path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment