diff options
author | Jon Leighton <j@jonathanleighton.com> | 2013-03-08 15:10:00 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2013-03-08 15:10:46 +0000 |
commit | e5fc096bea4e56a9eb17a80f12775b92c8a8f1ee (patch) | |
tree | a633cbc0eef3e719fc135a4ce9f1303a155dcbd4 /railties | |
parent | 8f9c81b15c79903203cd11e51bed5f848e759243 (diff) | |
download | rails-e5fc096bea4e56a9eb17a80f12775b92c8a8f1ee.tar.gz rails-e5fc096bea4e56a9eb17a80f12775b92c8a8f1ee.tar.bz2 rails-e5fc096bea4e56a9eb17a80f12775b92c8a8f1ee.zip |
The console --sandbox transaction should not be joinable
Thanks @neerajdotname for noticing this bug.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/console_test.rb | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/railties/test/application/console_test.rb b/railties/test/application/console_test.rb index 588682d3d4..592bd73924 100644 --- a/railties/test/application/console_test.rb +++ b/railties/test/application/console_test.rb @@ -119,9 +119,11 @@ class FullStackConsoleTest < ActiveSupport::TestCase assert output.include?(expected), "#{expected.inspect} expected, but got:\n\n#{output}" end - def write_prompt(command) + def write_prompt(command, expected_output = nil) @master.puts command assert_output command + assert_output expected_output if expected_output + assert_output "> " end def kill(pid) @@ -143,21 +145,17 @@ class FullStackConsoleTest < ActiveSupport::TestCase def test_sandbox pid = spawn_console - write_prompt "Post.count" - assert_output "=> 0" - + write_prompt "Post.count", "=> 0" write_prompt "Post.create" - assert_output "=> " - - write_prompt "Post.count" - assert_output "=> 1" + write_prompt "Post.count", "=> 1" kill pid pid = spawn_console - write_prompt "Post.count" - assert_output "=> 0" + write_prompt "Post.count", "=> 0" + write_prompt "Post.transaction { Post.create; raise }" + write_prompt "Post.count", "=> 0" ensure kill pid end |