Methods
- I
- L
- S
- T
Included Modules
Instance Public methods
irb_context()
Link
load_environment(sandbox = false)
Link
setup()
Link
teardown()
Link
test_access_to_helpers()
Link
# File railties/test/application/console_test.rb, line 87 def test_access_to_helpers load_environment helper = irb_context.helper assert_not_nil helper assert_instance_of ActionView::Base, helper assert_equal 'Once upon a time in a world...', helper.truncate('Once upon a time in a world far far away') end
test_app_can_access_path_helper_method()
Link
# File railties/test/application/console_test.rb, line 32 def test_app_can_access_path_helper_method app_file 'config/routes.rb', <<-RUBY Rails.application.routes.draw do get 'foo', to: 'foo#index' end RUBY load_environment console_session = irb_context.app assert_equal '/foo', console_session.foo_path end
test_app_method_should_return_integration_session()
Link
# File railties/test/application/console_test.rb, line 25 def test_app_method_should_return_integration_session TestHelpers::Rack.send :remove_method, :app load_environment console_session = irb_context.app assert_instance_of ActionDispatch::Integration::Session, console_session end
test_new_session_should_return_integration_session()
Link
test_reload_should_fire_preparation_and_cleanup_callbacks()
Link
# File railties/test/application/console_test.rb, line 50 def test_reload_should_fire_preparation_and_cleanup_callbacks load_environment a = b = c = nil # TODO: These should be defined on the initializer ActiveSupport::Reloader.to_complete { a = b = c = 1 } ActiveSupport::Reloader.to_complete { b = c = 2 } ActiveSupport::Reloader.to_prepare { c = 3 } irb_context.reload!(false) assert_equal 1, a assert_equal 2, b assert_equal 3, c end
test_reload_should_reload_constants()
Link
# File railties/test/application/console_test.rb, line 66 def test_reload_should_reload_constants app_file "app/models/user.rb", <<-MODEL class User attr_accessor :name end MODEL load_environment assert User.new.respond_to?(:name) app_file "app/models/user.rb", <<-MODEL class User attr_accessor :name, :age end MODEL assert !User.new.respond_to?(:age) irb_context.reload!(false) assert User.new.respond_to?(:age) end