Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Adding SMS capabilities to your Rails Application
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
test "#new" do
get :new
assert_response :success
assert_template :new
end
test "#create succeeds" do
assert_difference 'User.count' do
post :create, user: {name: 'John Doe', email: 'john@doe.com', phone: '555-444-3434'}
assert_response :ok
end
end
test "#create fails on validation" do
assert_no_difference 'User.count' do
post :create, user: {name: 'Joe'}
assert_response :ok
assert_template :new
assert !assigns(:user).valid?
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.