mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-18 00:00:12 +01:00
Removed superfluous 'tracks' directory at the root of the repository.
Testing commits to github.
This commit is contained in:
parent
6a42901514
commit
4cbf5a34d3
2269 changed files with 0 additions and 0 deletions
56
test/selenium_helper.rb
Normal file
56
test/selenium_helper.rb
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
class SeleniumHelperController < ActionController::Base
|
||||
def login
|
||||
if params[:as]
|
||||
user = User.find_by_login(params[:as].to_s)
|
||||
session['user_id'] = user
|
||||
user.contexts.each do |c|
|
||||
cookies["tracks_#{user.login}_context_c#{c.id}_collapsed"] = nil
|
||||
end
|
||||
end
|
||||
|
||||
render :text => "Logged in as #{params[:as]}"
|
||||
end
|
||||
end
|
||||
|
||||
ActionController::Routing::Routes.add_route '/selenium_helper/login', :controller => 'selenium_helper', :action => 'login'
|
||||
|
||||
module SeleniumOnRails::TestBuilderActions
|
||||
def login options = {}
|
||||
options = {options => nil} unless options.is_a? Hash
|
||||
opts = {:controller => 'selenium_helper', :action => 'login'}.merge(options)
|
||||
open opts
|
||||
end
|
||||
end
|
||||
|
||||
# The accessors available for SeleniumOnRails::TestBuilder tests.
|
||||
#
|
||||
# For each +store_foo+ there's +assert_foo+, +assert_not_foo+, +verify_foo+,
|
||||
# +verify_not_foo+, +wait_for_foo+, +wait_for_not_foo+.
|
||||
module SeleniumOnRails::TestBuilderAccessors
|
||||
|
||||
# How many elements with the class "context" are present on the page?
|
||||
#
|
||||
# Related Assertions, automatically generated:
|
||||
# * +assert_context_count+
|
||||
# * +assert_not_context_count+
|
||||
# * +verify_context_count+
|
||||
# * +verify_not_context_count+
|
||||
# * +wait_for_context_count+
|
||||
# * +wait_for_not_context_count+
|
||||
def store_context_count variable_name
|
||||
command 'storeContextCount', variable_name
|
||||
end
|
||||
|
||||
each_assertion 'store_context_count' do |assertion_method, command_name|
|
||||
define_method assertion_method do |expected_count|
|
||||
command command_name, expected_count
|
||||
end
|
||||
end
|
||||
|
||||
def assert_context_count_incremented(&block)
|
||||
store_context_count 'initial_context_count'
|
||||
store_eval "${initial_context_count} + 1", 'expected_context_count'
|
||||
yield
|
||||
wait_for_context_count "${expected_context_count}"
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue