mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-09-18 06:22:08 +09:00
Hello world
First open source release of Campfire 🎉
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
require "test_helper"
|
||||
|
||||
class Users::ProfilesControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in :david
|
||||
end
|
||||
|
||||
test "show" do
|
||||
get user_profile_url
|
||||
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "update" do
|
||||
put user_profile_url, params: { user: { name: "John Doe", bio: "Acrobat" } }
|
||||
|
||||
assert_redirected_to user_profile_url
|
||||
assert_equal "John Doe", users(:david).reload.name
|
||||
assert_equal "Acrobat", users(:david).bio
|
||||
assert_equal "david@37signals.com", users(:david).email_address
|
||||
end
|
||||
|
||||
test "updates are limited to the current user" do
|
||||
put user_profile_url(users(:jason)), params: { user: { name: "John Doe" } }
|
||||
|
||||
assert_equal "Jason", users(:jason).reload.name
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user