mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-24 14:46:48 +09:00
Hello world
First open source release of Campfire 🎉
This commit is contained in:
commit
df76a227dc
664 files changed
+36235
No files matched your search
@@ -0,0 +1,33 @@
|
||||
require "test_helper"
|
||||
|
||||
class FirstRunsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
Account.destroy_all
|
||||
User.destroy_all
|
||||
Room.destroy_all
|
||||
end
|
||||
|
||||
test "new is permitted when no other users exit" do
|
||||
get first_run_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "new is not permitted when account exist" do
|
||||
Account.create!(name: "Chat")
|
||||
|
||||
get first_run_url
|
||||
assert_redirected_to root_url
|
||||
end
|
||||
|
||||
test "create" do
|
||||
assert_difference -> { Room.count }, 1 do
|
||||
assert_difference -> { User.count }, 1 do
|
||||
post first_run_url, params: { account: { name: "37signals" }, user: { name: "New Person", email_address: "new@37signals.com", password: "secret123456" } }
|
||||
end
|
||||
end
|
||||
|
||||
assert_redirected_to root_url
|
||||
|
||||
assert parsed_cookies.signed[:session_token]
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user