mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-20 01:00:13 +01:00
Update selenium on rails using 'official' git repo
git://github.com/paytonrules/selenium-on-rails.git
This commit is contained in:
parent
198f3240b8
commit
9b504b3e47
159 changed files with 16409 additions and 11794 deletions
|
|
@ -1,29 +1,30 @@
|
|||
require File.dirname(__FILE__) + '/test_helper'
|
||||
|
||||
class SetupTest < Test::Unit::TestCase
|
||||
def setup
|
||||
@controller = SeleniumController.new
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
def test_session_reset
|
||||
@request.session['key'] = 'value'
|
||||
get :setup
|
||||
assert_nil session['key']
|
||||
assert_response :success
|
||||
assert_tag :content => 'The session is wiped clean.'
|
||||
end
|
||||
|
||||
def test_session_no_reset
|
||||
@request.session['key'] = 'value'
|
||||
get :setup, :keep_session => true
|
||||
assert_equal 'value', session['key']
|
||||
assert_response :success
|
||||
assert_no_tag :content => 'The session is wiped clean.'
|
||||
end
|
||||
|
||||
#
|
||||
# Don't have the nerve to test fixtures since this is a plugin
|
||||
#
|
||||
end
|
||||
require File.dirname(__FILE__) + '/test_helper'
|
||||
require 'mocha'
|
||||
RAILS_ROOT = File.expand_path(File.dirname(__FILE__) + "/")
|
||||
|
||||
class SetupTest < Test::Unit::TestCase
|
||||
def setup
|
||||
@controller = SeleniumController.new
|
||||
SeleniumController.any_instance.stubs(:clear_tables).returns([])
|
||||
SeleniumController.any_instance.stubs(:layout_path).returns(false)
|
||||
ActionController::Routing::Routes.draw
|
||||
@request = ActionController::TestRequest.new
|
||||
@response = ActionController::TestResponse.new
|
||||
end
|
||||
|
||||
def test_session_reset
|
||||
@request.session['key'] = 'value'
|
||||
get :setup
|
||||
assert_nil session['key']
|
||||
assert_response :success
|
||||
assert_tag :content => 'The session is wiped clean.'
|
||||
end
|
||||
|
||||
def test_session_no_reset
|
||||
@request.session['key'] = 'value'
|
||||
get :setup, :keep_session => true
|
||||
assert_equal 'value', session['key']
|
||||
assert_response :success
|
||||
assert_no_tag :content => 'The session is wiped clean.'
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue