Skip to content

Commit

Permalink
Add a test to guard for web_console.exception priority
Browse files Browse the repository at this point in the history
  • Loading branch information
gsamokovarov committed Nov 24, 2014
1 parent d252134 commit 1d8a74e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/web_console/middleware_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,19 @@ def call(env)
end

test 'render console in an html application from web_console.exception' do
get '/', nil, 'CONTENT_TYPE' => 'text/html', 'web_console.binding' => raise_exception
get '/', nil, 'CONTENT_TYPE' => 'text/html', 'web_console.binding' => binding

assert_select '#console'
end

test 'prioritizes web_console.exception over web_console.binding' do
exception = raise_exception

REPLSession.expects(:create).with(binding: exception.bindings.first, binding_stack: exception.bindings)

get '/', nil, 'CONTENT_TYPE' => 'text/html', 'web_console.binding' => binding, 'web_console.exception' => exception
end

test 'render console in an html application with non text/html' do
get '/', nil, 'CONTENT_TYPE' => 'application/xhtml+xml', 'web_console.binding' => binding

Expand Down

0 comments on commit 1d8a74e

Please sign in to comment.