diff --git a/tracks/vendor/plugins/acts_as_state_machine/CHANGELOG b/tracks/vendor/plugins/acts_as_state_machine/CHANGELOG deleted file mode 100644 index b97ad744..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/CHANGELOG +++ /dev/null @@ -1,13 +0,0 @@ -* trunk * - break with true value [Kaspar Schiess] - -* 2.1 * - After actions [Saimon Moore] - -* 2.0 * (2006-01-20 15:26:28 -0500) - Enter / Exit actions - Transition guards - Guards and actions can be a symbol pointing to a method or a Proc - -* 1.0 * (2006-01-15 12:16:55 -0500) - Initial Release diff --git a/tracks/vendor/plugins/acts_as_state_machine/MIT-LICENSE b/tracks/vendor/plugins/acts_as_state_machine/MIT-LICENSE deleted file mode 100644 index 3189ba6b..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/MIT-LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2006 Scott Barron - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/tracks/vendor/plugins/acts_as_state_machine/README b/tracks/vendor/plugins/acts_as_state_machine/README deleted file mode 100644 index 2bbcced6..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/README +++ /dev/null @@ -1,33 +0,0 @@ -= Acts As State Machine - -This act gives an Active Record model the ability to act as a finite state -machine (FSM). - -Acquire via subversion at: - -http://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk - -If prompted, use the user/pass anonymous/anonymous. - -== Example - - class Order < ActiveRecord::Base - acts_as_state_machine :initial => :opened - - state :opened - state :closed, :enter => Proc.new {|o| Mailer.send_notice(o)} - state :returned - - event :close do - transitions :to => :closed, :from => :opened - end - - event :return do - transitions :to => :returned, :from => :closed - end - end - - o = Order.create - o.close! # notice is sent by mailer - o.return! - diff --git a/tracks/vendor/plugins/acts_as_state_machine/Rakefile b/tracks/vendor/plugins/acts_as_state_machine/Rakefile deleted file mode 100644 index 101fdde9..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/Rakefile +++ /dev/null @@ -1,28 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => [:clean_db, :test] - -desc 'Remove the stale db file' -task :clean_db do - `rm -f #{File.dirname(__FILE__)}/test/state_machine.sqlite.db` -end - -desc 'Test the acts as state machine plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the acts as state machine plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'Acts As State Machine' - rdoc.options << '--line-numbers --inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('TODO') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/tracks/vendor/plugins/acts_as_state_machine/TODO b/tracks/vendor/plugins/acts_as_state_machine/TODO deleted file mode 100644 index 8d5d7063..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/TODO +++ /dev/null @@ -1,11 +0,0 @@ -* Currently invalid events are ignored, create an option so that they can be - ignored or raise an exception. - -* Query for a list of possible next states. - -* Make listing states optional since they can be inferred from the events. - Only required to list a state if you want to define a transition block for it. - -* Real transition actions - -* Default states diff --git a/tracks/vendor/plugins/acts_as_state_machine/init.rb b/tracks/vendor/plugins/acts_as_state_machine/init.rb deleted file mode 100644 index dd1b4cd2..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/init.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'acts_as_state_machine' - -ActiveRecord::Base.class_eval do - include ScottBarron::Acts::StateMachine -end diff --git a/tracks/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb b/tracks/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb deleted file mode 100644 index 50d0439f..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/lib/acts_as_state_machine.rb +++ /dev/null @@ -1,268 +0,0 @@ -module ScottBarron #:nodoc: - module Acts #:nodoc: - module StateMachine #:nodoc: - class InvalidState < Exception #:nodoc: - end - class NoInitialState < Exception #:nodoc: - end - - def self.included(base) #:nodoc: - base.extend ActMacro - end - - module SupportingClasses - class State - attr_reader :name - - def initialize(name, opts) - @name, @opts = name, opts - end - - def entering(record) - enteract = @opts[:enter] - record.send(:run_transition_action, enteract) if enteract - end - - def entered(record) - afteractions = @opts[:after] - return unless afteractions - Array(afteractions).each do |afteract| - record.send(:run_transition_action, afteract) - end - end - - def exited(record) - exitact = @opts[:exit] - record.send(:run_transition_action, exitact) if exitact - end - end - - class StateTransition - attr_reader :from, :to, :opts - - def initialize(opts) - @from, @to, @guard = opts[:from], opts[:to], opts[:guard] - @opts = opts - end - - def guard(obj) - @guard ? obj.send(:run_transition_action, @guard) : true - end - - def perform(record) - return false unless guard(record) - loopback = record.current_state == to - states = record.class.read_inheritable_attribute(:states) - next_state = states[to] - old_state = states[record.current_state] - - next_state.entering(record) unless loopback - - record.update_attribute(record.class.state_column, to.to_s) - - next_state.entered(record) unless loopback - old_state.exited(record) unless loopback - true - end - - def ==(obj) - @from == obj.from && @to == obj.to - end - end - - class Event - attr_reader :name - attr_reader :transitions - attr_reader :opts - - def initialize(name, opts, transition_table, &block) - @name = name.to_sym - @transitions = transition_table[@name] = [] - instance_eval(&block) if block - @opts = opts - @opts.freeze - @transitions.freeze - freeze - end - - def next_states(record) - @transitions.select { |t| t.from == record.current_state } - end - - def fire(record) - next_states(record).each do |transition| - break true if transition.perform(record) - end - end - - def transitions(trans_opts) - Array(trans_opts[:from]).each do |s| - @transitions << SupportingClasses::StateTransition.new(trans_opts.merge({:from => s.to_sym})) - end - end - end - end - - module ActMacro - # Configuration options are - # - # * +column+ - specifies the column name to use for keeping the state (default: state) - # * +initial+ - specifies an initial state for newly created objects (required) - def acts_as_state_machine(opts) - self.extend(ClassMethods) - raise NoInitialState unless opts[:initial] - - write_inheritable_attribute :states, {} - write_inheritable_attribute :initial_state, opts[:initial] - write_inheritable_attribute :transition_table, {} - write_inheritable_attribute :event_table, {} - write_inheritable_attribute :state_column, opts[:column] || 'state' - - class_inheritable_reader :initial_state - class_inheritable_reader :state_column - class_inheritable_reader :transition_table - class_inheritable_reader :event_table - - self.send(:include, ScottBarron::Acts::StateMachine::InstanceMethods) - - before_create :set_initial_state - after_create :run_initial_state_actions - end - end - - module InstanceMethods - def set_initial_state #:nodoc: - write_attribute self.class.state_column, self.class.initial_state.to_s - end - - def run_initial_state_actions - initial = self.class.read_inheritable_attribute(:states)[self.class.initial_state.to_sym] - initial.entering(self) - initial.entered(self) - end - - # Returns the current state the object is in, as a Ruby symbol. - def current_state - self.send(self.class.state_column).to_sym - end - - # Returns what the next state for a given event would be, as a Ruby symbol. - def next_state_for_event(event) - ns = next_states_for_event(event) - ns.empty? ? nil : ns.first.to - end - - def next_states_for_event(event) - self.class.read_inheritable_attribute(:transition_table)[event.to_sym].select do |s| - s.from == current_state - end - end - - def run_transition_action(action) - Symbol === action ? self.method(action).call : action.call(self) - end - private :run_transition_action - end - - module ClassMethods - # Returns an array of all known states. - def states - read_inheritable_attribute(:states).keys - end - - # Define an event. This takes a block which describes all valid transitions - # for this event. - # - # Example: - # - # class Order < ActiveRecord::Base - # acts_as_state_machine :initial => :open - # - # state :open - # state :closed - # - # event :close_order do - # transitions :to => :closed, :from => :open - # end - # end - # - # +transitions+ takes a hash where :to is the state to transition - # to and :from is a state (or Array of states) from which this - # event can be fired. - # - # This creates an instance method used for firing the event. The method - # created is the name of the event followed by an exclamation point (!). - # Example: order.close_order!. - def event(event, opts={}, &block) - tt = read_inheritable_attribute(:transition_table) - - et = read_inheritable_attribute(:event_table) - e = et[event.to_sym] = SupportingClasses::Event.new(event, opts, tt, &block) - define_method("#{event.to_s}!") { e.fire(self) } - end - - # Define a state of the system. +state+ can take an optional Proc object - # which will be executed every time the system transitions into that - # state. The proc will be passed the current object. - # - # Example: - # - # class Order < ActiveRecord::Base - # acts_as_state_machine :initial => :open - # - # state :open - # state :closed, Proc.new { |o| Mailer.send_notice(o) } - # end - def state(name, opts={}) - state = SupportingClasses::State.new(name.to_sym, opts) - read_inheritable_attribute(:states)[name.to_sym] = state - - define_method("#{state.name}?") { current_state == state.name } - end - - # Wraps ActiveRecord::Base.find to conveniently find all records in - # a given state. Options: - # - # * +number+ - This is just :first or :all from ActiveRecord +find+ - # * +state+ - The state to find - # * +args+ - The rest of the args are passed down to ActiveRecord +find+ - def find_in_state(number, state, *args) - with_state_scope state do - find(number, *args) - end - end - - # Wraps ActiveRecord::Base.count to conveniently count all records in - # a given state. Options: - # - # * +state+ - The state to find - # * +args+ - The rest of the args are passed down to ActiveRecord +find+ - def count_in_state(state, *args) - with_state_scope state do - count(*args) - end - end - - # Wraps ActiveRecord::Base.calculate to conveniently calculate all records in - # a given state. Options: - # - # * +state+ - The state to find - # * +args+ - The rest of the args are passed down to ActiveRecord +calculate+ - def calculate_in_state(state, *args) - with_state_scope state do - calculate(*args) - end - end - - protected - def with_state_scope(state) - raise InvalidState unless states.include?(state) - - with_scope :find => {:conditions => ["#{table_name}.#{state_column} = ?", state.to_s]} do - yield if block_given? - end - end - end - end - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/acts_as_state_machine/test/acts_as_state_machine_test.rb b/tracks/vendor/plugins/acts_as_state_machine/test/acts_as_state_machine_test.rb deleted file mode 100644 index e1135152..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/test/acts_as_state_machine_test.rb +++ /dev/null @@ -1,224 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -include ScottBarron::Acts::StateMachine - -class ActsAsStateMachineTest < Test::Unit::TestCase - fixtures :conversations - - def test_no_initial_value_raises_exception - assert_raise(NoInitialState) { - Person.acts_as_state_machine({}) - } - end - - def test_initial_state_value - assert_equal :needs_attention, Conversation.initial_state - end - - def test_column_was_set - assert_equal 'state_machine', Conversation.state_column - end - - def test_initial_state - c = Conversation.create - assert_equal :needs_attention, c.current_state - assert c.needs_attention? - end - - def test_states_were_set - [:needs_attention, :read, :closed, :awaiting_response, :junk].each do |s| - assert Conversation.states.include?(s) - end - end - - def test_event_methods_created - c = Conversation.create - %w(new_message! view! reply! close! junk! unjunk!).each do |event| - assert c.respond_to?(event) - end - end - - def test_query_methods_created - c = Conversation.create - %w(needs_attention? read? closed? awaiting_response? junk?).each do |event| - assert c.respond_to?(event) - end - end - - def test_transition_table - tt = Conversation.transition_table - - assert tt[:new_message].include?(SupportingClasses::StateTransition.new(:from => :read, :to => :needs_attention)) - assert tt[:new_message].include?(SupportingClasses::StateTransition.new(:from => :closed, :to => :needs_attention)) - assert tt[:new_message].include?(SupportingClasses::StateTransition.new(:from => :awaiting_response, :to => :needs_attention)) - end - - def test_next_state_for_event - c = Conversation.create - assert_equal :read, c.next_state_for_event(:view) - end - - def test_change_state - c = Conversation.create - c.view! - assert c.read? - end - - def test_can_go_from_read_to_closed_because_guard_passes - c = Conversation.create - c.can_close = true - c.view! - c.reply! - c.close! - assert_equal :closed, c.current_state - end - - def test_cannot_go_from_read_to_closed_because_of_guard - c = Conversation.create - c.can_close = false - c.view! - c.reply! - c.close! - assert_equal :read, c.current_state - end - - def test_ignore_invalid_events - c = Conversation.create - c.view! - c.junk! - - # This is the invalid event - c.new_message! - assert_equal :junk, c.current_state - end - - def test_entry_action_executed - c = Conversation.create - c.read_enter = false - c.view! - assert c.read_enter - end - - def test_after_actions_executed - c = Conversation.create - - c.read_after_first = false - c.read_after_second = false - c.closed_after = false - - c.view! - assert c.read_after_first - assert c.read_after_second - - c.can_close = true - c.close! - - assert c.closed_after - assert_equal :closed, c.current_state - end - - def test_after_actions_not_run_on_loopback_transition - c = Conversation.create - - c.view! - c.read_after_first = false - c.read_after_second = false - c.view! - - assert !c.read_after_first - assert !c.read_after_second - - c.can_close = true - - c.close! - c.closed_after = false - c.close! - - assert !c.closed_after - end - - def test_exit_action_executed - c = Conversation.create - c.read_exit = false - c.view! - c.junk! - assert c.read_exit - end - - def test_entry_and_exit_not_run_on_loopback_transition - c = Conversation.create - c.view! - c.read_enter = false - c.read_exit = false - c.view! - assert !c.read_enter - assert !c.read_exit - end - - def test_entry_and_after_actions_called_for_initial_state - c = Conversation.create - assert c.needs_attention_enter - assert c.needs_attention_after - end - - def test_run_transition_action_is_private - c = Conversation.create - assert_raise(NoMethodError) { c.run_transition_action :foo } - end - - def test_find_all_in_state - cs = Conversation.find_in_state(:all, :read) - - assert_equal 2, cs.size - end - - def test_find_first_in_state - c = Conversation.find_in_state(:first, :read) - - assert_equal conversations(:first).id, c.id - end - - def test_find_all_in_state_with_conditions - cs = Conversation.find_in_state(:all, :read, :conditions => ['subject = ?', conversations(:second).subject]) - - assert_equal 1, cs.size - assert_equal conversations(:second).id, cs.first.id - end - - def test_find_first_in_state_with_conditions - c = Conversation.find_in_state(:first, :read, :conditions => ['subject = ?', conversations(:second).subject]) - assert_equal conversations(:second).id, c.id - end - - def test_count_in_state - cnt0 = Conversation.count(['state_machine = ?', 'read']) - cnt = Conversation.count_in_state(:read) - - assert_equal cnt0, cnt - end - - def test_count_in_state_with_conditions - cnt0 = Conversation.count(['state_machine = ? AND subject = ?', 'read', 'Foo']) - cnt = Conversation.count_in_state(:read, ['subject = ?', 'Foo']) - - assert_equal cnt0, cnt - end - - def test_find_in_invalid_state_raises_exception - assert_raise(InvalidState) { - Conversation.find_in_state(:all, :dead) - } - end - - def test_count_in_invalid_state_raises_exception - assert_raise(InvalidState) { - Conversation.count_in_state(:dead) - } - end - - def test_can_access_events_via_event_table - event = Conversation.event_table[:junk] - assert_equal :junk, event.name - assert_equal "finished", event.opts[:note] - end -end diff --git a/tracks/vendor/plugins/acts_as_state_machine/test/database.yml b/tracks/vendor/plugins/acts_as_state_machine/test/database.yml deleted file mode 100644 index f012c25c..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/test/database.yml +++ /dev/null @@ -1,18 +0,0 @@ -sqlite: - :adapter: sqlite - :dbfile: state_machine.sqlite.db -sqlite3: - :adapter: sqlite3 - :dbfile: state_machine.sqlite3.db -postgresql: - :adapter: postgresql - :username: postgres - :password: postgres - :database: state_machine_test - :min_messages: ERROR -mysql: - :adapter: mysql - :host: localhost - :username: rails - :password: - :database: state_machine_test \ No newline at end of file diff --git a/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/conversation.rb b/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/conversation.rb deleted file mode 100644 index 8b414325..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/conversation.rb +++ /dev/null @@ -1,67 +0,0 @@ -class Conversation < ActiveRecord::Base - attr_writer :can_close - attr_accessor :read_enter, :read_exit, :read_after_first, :read_after_second, - :closed_after, :needs_attention_enter, :needs_attention_after - - acts_as_state_machine :initial => :needs_attention, :column => 'state_machine' - - state :needs_attention, :enter => Proc.new { |o| o.needs_attention_enter = true }, - :after => Proc.new { |o| o.needs_attention_after = true } - - state :read, :enter => :read_enter_action, - :exit => Proc.new { |o| o.read_exit = true }, - :after => [:read_after_first_action, :read_after_second_action] - - state :closed, :after => :closed_after_action - state :awaiting_response - state :junk - - event :new_message do - transitions :to => :needs_attention, :from => [:read, :closed, :awaiting_response] - end - - event :view do - transitions :to => :read, :from => [:needs_attention, :read] - end - - event :reply do - transitions :to => :awaiting_response, :from => [:read, :closed] - end - - event :close do - transitions :to => :closed, :from => [:read, :awaiting_response], :guard => Proc.new {|o| o.can_close?} - transitions :to => :read, :from => [:read, :awaiting_response], :guard => :always_true - end - - event :junk, :note => "finished" do - transitions :to => :junk, :from => [:read, :closed, :awaiting_response] - end - - event :unjunk do - transitions :to => :closed, :from => :junk - end - - def can_close? - @can_close - end - - def read_enter_action - self.read_enter = true - end - - def always_true - true - end - - def read_after_first_action - self.read_after_first = true - end - - def read_after_second_action - self.read_after_second = true - end - - def closed_after_action - self.closed_after = true - end -end diff --git a/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/conversations.yml b/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/conversations.yml deleted file mode 100644 index 572e0ee1..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/conversations.yml +++ /dev/null @@ -1,11 +0,0 @@ -first: - id: 1 - state_machine: read - subject: This is a test - closed: false - -second: - id: 2 - state_machine: read - subject: Foo - closed: false diff --git a/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/person.rb b/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/person.rb deleted file mode 100644 index e64a8262..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/test/fixtures/person.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Person < ActiveRecord::Base -end \ No newline at end of file diff --git a/tracks/vendor/plugins/acts_as_state_machine/test/schema.rb b/tracks/vendor/plugins/acts_as_state_machine/test/schema.rb deleted file mode 100644 index 50128995..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/test/schema.rb +++ /dev/null @@ -1,11 +0,0 @@ -ActiveRecord::Schema.define(:version => 1) do - create_table :conversations, :force => true do |t| - t.column :state_machine, :string - t.column :subject, :string - t.column :closed, :boolean - end - - create_table :people, :force => true do |t| - t.column :name, :string - end -end diff --git a/tracks/vendor/plugins/acts_as_state_machine/test/test_helper.rb b/tracks/vendor/plugins/acts_as_state_machine/test/test_helper.rb deleted file mode 100644 index 95331d03..00000000 --- a/tracks/vendor/plugins/acts_as_state_machine/test/test_helper.rb +++ /dev/null @@ -1,38 +0,0 @@ -$:.unshift(File.dirname(__FILE__) + '/../lib') -RAILS_ROOT = File.dirname(__FILE__) - -require 'rubygems' -require 'test/unit' -require 'active_record' -require 'active_record/fixtures' -require 'active_support/binding_of_caller' -require 'active_support/breakpoint' -require "#{File.dirname(__FILE__)}/../init" - - -config = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml')) -ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + "/debug.log") -ActiveRecord::Base.establish_connection(config[ENV['DB'] || 'sqlite']) - -load(File.dirname(__FILE__) + "/schema.rb") if File.exist?(File.dirname(__FILE__) + "/schema.rb") - -Test::Unit::TestCase.fixture_path = File.dirname(__FILE__) + "/fixtures/" -$LOAD_PATH.unshift(Test::Unit::TestCase.fixture_path) - -class Test::Unit::TestCase #:nodoc: - def create_fixtures(*table_names) - if block_given? - Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names) { yield } - else - Fixtures.create_fixtures(Test::Unit::TestCase.fixture_path, table_names) - end - end - - # Turn off transactional fixtures if you're working with MyISAM tables in MySQL - self.use_transactional_fixtures = true - - # Instantiated fixtures are slow, but give you @david where you otherwise would need people(:david) - self.use_instantiated_fixtures = false - - # Add more helper methods to be used by all tests here... -end \ No newline at end of file diff --git a/tracks/vendor/plugins/arts/README b/tracks/vendor/plugins/arts/README deleted file mode 100644 index a15c6d21..00000000 --- a/tracks/vendor/plugins/arts/README +++ /dev/null @@ -1,28 +0,0 @@ -ARTS is Another RJS Test System - -For a complete tutorial, see http://glu.ttono.us/articles/2006/05/29/guide-test-driven-rjs-with-arts. - -Usage: - assert_rjs :alert, 'Hi!' - assert_rjs :assign, 'a', '2' - assert_rjs :call, 'foo', 'bar', 'baz' - assert_rjs :draggable, 'draggable_item' - assert_rjs :drop_receiving, 'receiving_item' - assert_rjs :hide, "post_1", "post_2", "post_3" - assert_rjs :insert_html, :bottom, 'posts' - assert_rjs :redirect_to, :action => 'list' - assert_rjs :remove, "post_1", "post_2", "post_3" - assert_rjs :replace, 'completely_replaced_div' - assert_rjs :replace, 'completely_replaced_div', '

This replaced the div

' - assert_rjs :replace, 'completely_replaced_div', /replaced the div/ - assert_rjs :replace_html, 'replaceable_div', "This goes inside the div" - assert_rjs :show, "post_1", "post_2", "post_3" - assert_rjs :sortable, 'sortable_item' - assert_rjs :toggle, "post_1", "post_2", "post_3" - assert_rjs :visual_effect, :highlight, "posts", :duration => '1.0' - -For the square bracket syntax (page['some_id'].toggle) use :page followed by the id and then subsequent method calls. Assignment requires a '=' at the end of the method name followed by the value. - - assert_rjs :page, 'some_id', :toggle - assert_rjs :page, 'some_id', :style, :color=, 'red' - diff --git a/tracks/vendor/plugins/arts/about.yml b/tracks/vendor/plugins/arts/about.yml deleted file mode 100644 index 5b8d9848..00000000 --- a/tracks/vendor/plugins/arts/about.yml +++ /dev/null @@ -1,7 +0,0 @@ -author: Kevin Clark -summary: RJS Assertion Plugin -homepage: http://glu.ttono.us -plugin: -version: 0.5 -license: MIT -rails_version: 1.1.2+ \ No newline at end of file diff --git a/tracks/vendor/plugins/arts/init.rb b/tracks/vendor/plugins/arts/init.rb deleted file mode 100644 index f43aa1e2..00000000 --- a/tracks/vendor/plugins/arts/init.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Give testing some culture -require 'test/unit/testcase' -Test::Unit::TestCase.send :include, Arts diff --git a/tracks/vendor/plugins/arts/install.rb b/tracks/vendor/plugins/arts/install.rb deleted file mode 100644 index a63be40f..00000000 --- a/tracks/vendor/plugins/arts/install.rb +++ /dev/null @@ -1 +0,0 @@ -puts IO.read(File.join(File.dirname(__FILE__), 'README')) \ No newline at end of file diff --git a/tracks/vendor/plugins/arts/lib/arts.rb b/tracks/vendor/plugins/arts/lib/arts.rb deleted file mode 100644 index 6bc232ef..00000000 --- a/tracks/vendor/plugins/arts/lib/arts.rb +++ /dev/null @@ -1,133 +0,0 @@ -module Arts - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::JavaScriptHelper - - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - - def assert_rjs(action, *args, &block) - respond_to?("assert_rjs_#{action}") ? - send("assert_rjs_#{action}", *args) : - assert(lined_response.include?(create_generator.send(action, *args, &block)), - generic_error(action, args)) - end - - def assert_no_rjs(action, *args, &block) - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs(action, *args, &block) } - end - - def assert_rjs_insert_html(*args) - position = args.shift - item_id = args.shift - - content = extract_matchable_content(args) - - unless content.blank? - case content - when Regexp - assert_match Regexp.new("new Insertion\.#{position.to_s.camelize}(.*#{item_id}.*,.*#{content.source}.*);"), - @response.body - when String - assert lined_response.include?("new Insertion.#{position.to_s.camelize}(\"#{item_id}\", #{content});"), - "No insert_html call found for \n" + - " position: '#{position}' id: '#{item_id}' \ncontent: \n" + - "#{content}\n" + - "in response:\n#{lined_response}" - else - raise "Invalid content type" - end - else - assert_match Regexp.new("new Insertion\.#{position.to_s.camelize}(.*#{item_id}.*,.*?);"), - @response.body - end - end - - def assert_rjs_replace_html(*args) - div = args.shift - content = extract_matchable_content(args) - - unless content.blank? - case content - when Regexp - assert_match Regexp.new("Element.update(.*#{div}.*,.*#{content.source}.*);"), - @response.body - when String - assert lined_response.include?("Element.update(\"#{div}\", #{content});"), - "No replace_html call found on div: '#{div}' and content: \n#{content}\n" + - "in response:\n#{lined_response}" - else - raise "Invalid content type" - end - else - assert_match Regexp.new("Element.update(.*#{div}.*,.*?);"), @response.body - end - end - - def assert_rjs_replace(*args) - div = args.shift - content = extract_matchable_content(args) - - unless content.blank? - case content - when Regexp - assert_match Regexp.new("Element.replace(.*#{div}.*,.*#{content.source}.*);"), - @response.body - when String - assert lined_response.include?("Element.replace(\"#{div}\", #{content});"), - "No replace call found on div: '#{div}' and content: \n#{content}\n" + - "in response:\n#{lined_response}" - else - raise "Invalid content type" - end - else - assert_match Regexp.new("Element.replace(.*#{div}.*,.*?);"), @response.body - end - end - - # To deal with [] syntax. I hate JavaScriptProxy so.. SO very much - def assert_rjs_page(*args) - content = build_method_chain!(args) - assert_match Regexp.new(Regexp.escape(content)), @response.body, - "Content did not include:\n #{content.to_s}" - end - - protected - - def build_method_chain!(args) - content = create_generator.send(:[], args.shift) # start $('some_id').... - - while !args.empty? - if (method = args.shift.to_s) =~ /(.*)=$/ - content = content.__send__(method, args.shift) - break - else - content = content.__send__(method) - content = content.__send__(:function_chain).first if args.empty? - end - end - - content - end - - def lined_response - @response.body.split("\n") - end - - def create_generator - block = Proc.new { |*args| yield *args if block_given? } - JavaScriptGenerator.new self, &block - end - - def generic_error(action, args) - "#{action} with args [#{args.join(" ")}] does not show up in response:\n#{lined_response}" - end - - def extract_matchable_content(args) - if args.size == 1 and args.first.is_a? Regexp - return args.first - else - return create_generator.send(:arguments_for_call, args) - end - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/arts/test/arts_test.rb b/tracks/vendor/plugins/arts/test/arts_test.rb deleted file mode 100644 index fad2be37..00000000 --- a/tracks/vendor/plugins/arts/test/arts_test.rb +++ /dev/null @@ -1,402 +0,0 @@ -$:.unshift(File.dirname(__FILE__) + '/../lib') - -require File.dirname(__FILE__) + '/../../../../config/environment' -require 'test/unit' -require 'rubygems' -require 'breakpoint' - -require 'action_controller/test_process' - -ActionController::Base.logger = nil -ActionController::Base.ignore_missing_templates = false -ActionController::Routing::Routes.reload rescue nil - -class ArtsController < ActionController::Base - def alert - render :update do |page| - page.alert 'This is an alert' - end - end - - def assign - render :update do |page| - page.assign 'a', '2' - end - end - - def call - render :update do |page| - page.call 'foo', 'bar', 'baz' - end - end - - def draggable - render :update do |page| - page.draggable 'my_image', :revert => true - end - end - - def drop_receiving - render :update do |page| - page.drop_receiving "my_cart", :url => { :controller => "cart", :action => "add" } - end - end - - def hide - render :update do |page| - page.hide 'some_div' - end - end - - def insert_html - render :update do |page| - page.insert_html :bottom, 'content', 'Stuff in the content div' - end - end - - def redirect - render :update do |page| - page.redirect_to :controller => 'sample', :action => 'index' - end - end - - def remove - render :update do |page| - page.remove 'offending_div' - end - end - - def replace - render :update do |page| - page.replace 'person_45', '
This replaces person_45
' - end - end - - def replace_html - render :update do |page| - page.replace_html 'person_45', 'This goes inside person_45' - end - end - - def show - render :update do |page| - page.show 'post_1', 'post_2', 'post_3' - end - end - - def sortable - render :update do |page| - page.sortable 'sortable_item' - end - end - - def toggle - render :update do |page| - page.toggle "post_1", "post_2", "post_3" - end - end - - def visual_effect - render :update do |page| - page.visual_effect :highlight, "posts", :duration => '1.0' - end - end - - def page_with_one_chained_method - render :update do |page| - page['some_id'].toggle - end - end - - def page_with_assignment - render :update do |page| - page['some_id'].style.color = 'red' - end - end - - def rescue_errors(e) raise e end - -end - -class ArtsTest < Test::Unit::TestCase - def setup - @controller = ArtsController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_alert - get :alert - - assert_nothing_raised { assert_rjs :alert, 'This is an alert' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :alert, 'This is not an alert' - end - - assert_nothing_raised { assert_no_rjs :alert, 'This is not an alert' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :alert, 'This is an alert' - end - end - - def test_assign - get :assign - - assert_nothing_raised { assert_rjs :assign, 'a', '2' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :assign, 'a', '3' - end - - assert_nothing_raised { assert_no_rjs :assign, 'a', '3' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :assign, 'a', '2' - end - end - - def test_call - get :call - - assert_nothing_raised { assert_rjs :call, 'foo', 'bar', 'baz' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :call, 'foo', 'bar' - end - - assert_nothing_raised { assert_no_rjs :call, 'foo', 'bar' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :call, 'foo', 'bar', 'baz' - end - end - - def test_draggable - get :draggable - - assert_nothing_raised { assert_rjs :draggable, 'my_image', :revert => true } - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :draggable, 'not_my_image' - end - - assert_nothing_raised { assert_no_rjs :draggable, 'not_my_image' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :draggable, 'my_image', :revert => true - end - end - - def test_drop_receiving - get :drop_receiving - - assert_nothing_raised { assert_rjs :drop_receiving, "my_cart", :url => { :controller => "cart", :action => "add" } } - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :drop_receiving, "my_cart" - end - - assert_nothing_raised { assert_no_rjs :drop_receiving, "my_cart" } - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :drop_receiving, "my_cart", :url => { :controller => "cart", :action => "add" } - end - end - - def test_hide - get :hide - - assert_nothing_raised { assert_rjs :hide, 'some_div' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :hide, 'some_other_div' - end - - assert_nothing_raised { assert_no_rjs :hide, 'not_some_div' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :hide, 'some_div' - end - end - - def test_insert_html - get :insert_html - - - assert_nothing_raised do - # No content matching - assert_rjs :insert_html, :bottom, 'content' - # Exact content matching - assert_rjs :insert_html, :bottom, 'content', 'Stuff in the content div' - # Regex matching - assert_rjs :insert_html, :bottom, 'content', /in.*content/ - - assert_no_rjs :insert_html, :bottom, 'not_our_div' - - assert_no_rjs :insert_html, :bottom, 'content', /in.*no content/ - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :insert_html, :bottom, 'content' - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :insert_html, :bottom, 'no_content' - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :insert_html, :bottom, 'content', /in the/ - end - end - - def test_redirect_to - get :redirect - - assert_nothing_raised do - assert_rjs :redirect_to, :controller => 'sample', :action => 'index' - assert_no_rjs :redirect_to, :controller => 'sample', :action => 'show' - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :redirect_to, :controller => 'doesnt', :action => 'exist' - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :redirect_to, :controller => 'sample', :action => 'index' - end - end - - def test_remove - get :remove - - assert_nothing_raised do - assert_rjs :remove, 'offending_div' - assert_no_rjs :remove, 'dancing_happy_div' - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :remove, 'dancing_happy_div' - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :remove, 'offending_div' - end - end - - def test_replace - get :replace - - assert_nothing_raised do - # No content matching - assert_rjs :replace, 'person_45' - # String content matching - assert_rjs :replace, 'person_45', '
This replaces person_45
' - # regexp content matching - assert_rjs :replace, 'person_45', /
.*person_45.*<\/div>/ - - assert_no_rjs :replace, 'person_45', '
This replaces person_46
' - - assert_no_rjs :replace, 'person_45', /person_46/ - end - - assert_raises(Test::Unit::AssertionFailedError) { assert_no_rjs :replace, 'person_45' } - assert_raises(Test::Unit::AssertionFailedError) { assert_no_rjs :replace, 'person_45', /person_45/ } - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs :replace, 'person_46' } - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs :replace, 'person_45', 'bad stuff' } - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs :replace, 'person_45', /not there/} - end - - def test_replace_html - get :replace_html - - assert_nothing_raised do - # No content matching - assert_rjs :replace_html, 'person_45' - # String content matching - assert_rjs :replace_html, 'person_45', 'This goes inside person_45' - # Regexp content matching - assert_rjs :replace_html, 'person_45', /goes inside/ - - assert_no_rjs :replace_html, 'person_46' - - assert_no_rjs :replace_html, 'person_45', /doesn't go inside/ - end - - assert_raises(Test::Unit::AssertionFailedError) { assert_no_rjs :replace_html, 'person_45' } - assert_raises(Test::Unit::AssertionFailedError) { assert_no_rjs :replace_html, 'person_45', /goes/ } - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs :replace_html, 'person_46' } - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs :replace_html, 'person_45', /gos inside/ } - end - - def test_show - get :show - assert_nothing_raised do - assert_rjs :show, "post_1", "post_2", "post_3" - assert_no_rjs :show, 'post_4' - end - - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs :show, 'post_4' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :show, "post_1", "post_2", "post_3" - end - end - - def test_sortable - get :sortable - assert_nothing_raised do - assert_rjs :sortable, 'sortable_item' - assert_no_rjs :sortable, 'non-sortable-item' - end - - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs :sortable, 'non-sortable-item' } - assert_raises(Test::Unit::AssertionFailedError) { assert_no_rjs :sortable, 'sortable_item' } - end - - def test_toggle - get :toggle - assert_nothing_raised do - assert_rjs :toggle, "post_1", "post_2", "post_3" - assert_no_rjs :toggle, 'post_4' - end - - assert_raises(Test::Unit::AssertionFailedError) { assert_rjs :toggle, 'post_4' } - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :toggle, "post_1", "post_2", "post_3" - end - end - - def test_visual_effect - get :visual_effect - assert_nothing_raised do - assert_rjs :visual_effect, :highlight, "posts", :duration => '1.0' - assert_no_rjs :visual_effect, :highlight, "lists" - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :visual_effect, :highlight, "lists" - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :visual_effect, :highlight, "posts", :duration => '1.0' - end - end - - # [] support - - def test_page_with_one_chained_method - get :page_with_one_chained_method - assert_nothing_raised do - assert_rjs :page, 'some_id', :toggle - assert_no_rjs :page, 'some_other_id', :toggle - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_rjs :page, 'some_other_id', :toggle - assert_no_rjs :page, 'some_id', :toggle - end - end - - def test_page_with_assignment - get :page_with_assignment - - assert_nothing_raised do - assert_rjs :page, 'some_id', :style, :color=, 'red' - assert_no_rjs :page, 'some_id', :color=, 'red' - end - - assert_raises(Test::Unit::AssertionFailedError) do - assert_no_rjs :page, 'some_id', :style, :color=, 'red' - assert_rjs :page, 'some_other_id', :style, :color=, 'red' - end - end -end diff --git a/tracks/vendor/plugins/extra_validations/init.rb b/tracks/vendor/plugins/extra_validations/init.rb deleted file mode 100644 index 17709ad4..00000000 --- a/tracks/vendor/plugins/extra_validations/init.rb +++ /dev/null @@ -1,2 +0,0 @@ -require 'extra_validations' -ActiveRecord::Base.extend ExtraValidations \ No newline at end of file diff --git a/tracks/vendor/plugins/extra_validations/lib/extra_validations.rb b/tracks/vendor/plugins/extra_validations/lib/extra_validations.rb deleted file mode 100644 index f5486e96..00000000 --- a/tracks/vendor/plugins/extra_validations/lib/extra_validations.rb +++ /dev/null @@ -1,29 +0,0 @@ -module ExtraValidations - - # Validates the value of the specified attribute by checking for a forbidden string - # - # class Person < ActiveRecord::Base - # validates_does_not_contain :first_name, :string => ',' - # end - # - # A string must be provided or else an exception will be raised. - # - # Configuration options: - # * message - A custom error message (default is: "is invalid") - # * string - The string to verify is not included (note: must be supplied!) - # * on Specifies when this validation is active (default is :save, other options :create, :update) - # * if - Specifies a method, proc or string to call to determine if the validation should - # occur (e.g. :if => :allow_validation, or :if => Proc.new { |user| user.signup_step > 2 }). The - # method, proc or string should return or evaluate to a true or false value. - def validates_does_not_contain(*attr_names) - configuration = { :message => ActiveRecord::Errors.default_error_messages[:invalid], :on => :save, :string => nil } - configuration.update(attr_names.pop) if attr_names.last.is_a?(Hash) - - raise(ArgumentError, "A string must be supplied as the :string option of the configuration hash") unless configuration[:string].is_a?(String) - - validates_each(attr_names, configuration) do |record, attr_name, value| - record.errors.add(attr_name, configuration[:message]) if value.to_s =~ Regexp.new(Regexp.escape(configuration[:string])) - end - end - -end diff --git a/tracks/vendor/plugins/has_many_polymorphs/LICENSE b/tracks/vendor/plugins/has_many_polymorphs/LICENSE deleted file mode 100644 index 90eec26b..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/LICENSE +++ /dev/null @@ -1,184 +0,0 @@ -Academic Free License (AFL) v. 3.0 - -This Academic Free License (the "License") applies to any original work -of authorship (the "Original Work") whose owner (the "Licensor") has -placed the following licensing notice adjacent to the copyright notice -for the Original Work: - -Licensed under the Academic Free License version 3.0 - -1) Grant of Copyright License. Licensor grants You a worldwide, -royalty-free, non-exclusive, sublicensable license, for the duration of -the copyright, to do the following: - -a) to reproduce the Original Work in copies, either alone or as part of -a collective work; - -b) to translate, adapt, alter, transform, modify, or arrange the -Original Work, thereby creating derivative works ("Derivative Works") -based upon the Original Work; - -c) to distribute or communicate copies of the Original Work and -Derivative Works to the public, under any license of your choice that -does not contradict the terms and conditions, including Licensor's -reserved rights and remedies, in this Academic Free License; - -d) to perform the Original Work publicly; and - -e) to display the Original Work publicly. - -2) Grant of Patent License. Licensor grants You a worldwide, -royalty-free, non-exclusive, sublicensable license, under patent claims -owned or controlled by the Licensor that are embodied in the Original -Work as furnished by the Licensor, for the duration of the patents, to -make, use, sell, offer for sale, have made, and import the Original Work -and Derivative Works. - -3) Grant of Source Code License. The term "Source Code" means the -preferred form of the Original Work for making modifications to it and -all available documentation describing how to modify the Original Work. -Licensor agrees to provide a machine-readable copy of the Source Code of -the Original Work along with each copy of the Original Work that -Licensor distributes. Licensor reserves the right to satisfy this -obligation by placing a machine-readable copy of the Source Code in an -information repository reasonably calculated to permit inexpensive and -convenient access by You for as long as Licensor continues to distribute -the Original Work. - -4) Exclusions From License Grant. Neither the names of Licensor, nor the -names of any contributors to the Original Work, nor any of their -trademarks or service marks, may be used to endorse or promote products -derived from this Original Work without express prior permission of the -Licensor. Except as expressly stated herein, nothing in this License -grants any license to Licensor's trademarks, copyrights, patents, trade -secrets or any other intellectual property. No patent license is granted -to make, use, sell, offer for sale, have made, or import embodiments of -any patent claims other than the licensed claims defined in Section 2. -No license is granted to the trademarks of Licensor even if such marks -are included in the Original Work. Nothing in this License shall be -interpreted to prohibit Licensor from licensing under terms different -from this License any Original Work that Licensor otherwise would have a -right to license. - -5) External Deployment. The term "External Deployment" means the use, -distribution, or communication of the Original Work or Derivative Works -in any way such that the Original Work or Derivative Works may be used -by anyone other than You, whether those works are distributed or -communicated to those persons or made available as an application -intended for use over a network. As an express condition for the grants -of license hereunder, You must treat any External Deployment by You of -the Original Work or a Derivative Work as a distribution under section -1(c). - -6) Attribution Rights. You must retain, in the Source Code of any -Derivative Works that You create, all copyright, patent, or trademark -notices from the Source Code of the Original Work, as well as any -notices of licensing and any descriptive text identified therein as an -"Attribution Notice." You must cause the Source Code for any Derivative -Works that You create to carry a prominent Attribution Notice reasonably -calculated to inform recipients that You have modified the Original -Work. - -7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants -that the copyright in and to the Original Work and the patent rights -granted herein by Licensor are owned by the Licensor or are sublicensed -to You under the terms of this License with the permission of the -contributor(s) of those copyrights and patent rights. Except as -expressly stated in the immediately preceding sentence, the Original -Work is provided under this License on an "AS IS" BASIS and WITHOUT -WARRANTY, either express or implied, including, without limitation, the -warranties of non-infringement, merchantability or fitness for a -particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL -WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential -part of this License. No license to the Original Work is granted by this -License except under this disclaimer. - -8) Limitation of Liability. Under no circumstances and under no legal -theory, whether in tort (including negligence), contract, or otherwise, -shall the Licensor be liable to anyone for any indirect, special, -incidental, or consequential damages of any character arising as a -result of this License or the use of the Original Work including, -without limitation, damages for loss of goodwill, work stoppage, -computer failure or malfunction, or any and all other commercial damages -or losses. This limitation of liability shall not apply to the extent -applicable law prohibits such limitation. - -9) Acceptance and Termination. If, at any time, You expressly assented -to this License, that assent indicates your clear and irrevocable -acceptance of this License and all of its terms and conditions. If You -distribute or communicate copies of the Original Work or a Derivative -Work, You must make a reasonable effort under the circumstances to -obtain the express assent of recipients to the terms of this License. -This License conditions your rights to undertake the activities listed -in Section 1, including your right to create Derivative Works based upon -the Original Work, and doing so without honoring these terms and -conditions is prohibited by copyright law and international treaty. -Nothing in this License is intended to affect copyright exceptions and -limitations (including "fair use" or "fair dealing"). This License shall -terminate immediately and You may no longer exercise any of the rights -granted to You by this License upon your failure to honor the conditions -in Section 1(c). - -10) Termination for Patent Action. This License shall terminate -automatically and You may no longer exercise any of the rights granted -to You by this License as of the date You commence an action, including -a cross-claim or counterclaim, against Licensor or any licensee alleging -that the Original Work infringes a patent. This termination provision -shall not apply for an action alleging patent infringement by -combinations of the Original Work with other software or hardware. - -11) Jurisdiction, Venue and Governing Law. Any action or suit relating -to this License may be brought only in the courts of a jurisdiction -wherein the Licensor resides or in which Licensor conducts its primary -business, and under the laws of that jurisdiction excluding its -conflict-of-law provisions. The application of the United Nations -Convention on Contracts for the International Sale of Goods is expressly -excluded. Any use of the Original Work outside the scope of this License -or after its termination shall be subject to the requirements and -penalties of copyright or patent law in the appropriate jurisdiction. -This section shall survive the termination of this License. - -12) Attorneys' Fees. In any action to enforce the terms of this License -or seeking damages relating thereto, the prevailing party shall be -entitled to recover its costs and expenses, including, without -limitation, reasonable attorneys' fees and costs incurred in connection -with such action, including any appeal of such action. This section -shall survive the termination of this License. - -13) Miscellaneous. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. - -14) Definition of "You" in This License. "You" throughout this License, -whether in upper or lower case, means an individual or a legal entity -exercising rights under, and complying with all of the terms of, this -License. For legal entities, "You" includes any entity that controls, is -controlled by, or is under common control with you. For purposes of this -definition, "control" means (i) the power, direct or indirect, to cause -the direction or management of such entity, whether by contract or -otherwise, or (ii) ownership of fifty percent (50%) or more of the -outstanding shares, or (iii) beneficial ownership of such entity. - -15) Right to Use. You may use the Original Work in all ways not -otherwise restricted or conditioned by this License or by law, and -Licensor promises not to interfere with or be responsible for such uses -by You. - -16) Modification of This License. This License is Copyright (c) 2005 -Lawrence Rosen. Permission is granted to copy, distribute, or -communicate this License without modification. Nothing in this License -permits You to modify this License as applied to the Original Work or to -Derivative Works. However, You may modify the text of this License and -copy, distribute or communicate your modified version (the "Modified -License") and apply it to other original works of authorship subject to -the following conditions: (i) You may not indicate in any way that your -Modified License is the "Academic Free License" or "AFL" and you may not -use those names in the name of your Modified License; (ii) You must -replace the notice specified in the first paragraph above with the -notice "Licensed under " or with a notice -of your own that is not confusingly similar to the notice in this -License; and (iii) You may not claim that your original works are open -source software unless your Modified License has been approved by Open -Source Initiative (OSI) and You comply with its license review and -certification process. - diff --git a/tracks/vendor/plugins/has_many_polymorphs/README b/tracks/vendor/plugins/has_many_polymorphs/README deleted file mode 100644 index 1cf509a6..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/README +++ /dev/null @@ -1,46 +0,0 @@ - -Self-referential, polymorphic has_many :through helper - -Copyright 2006 Evan Weaver (see the LICENSE file) - -"model :parent_class" may be required in some controllers or perhaps models in order for reloading to work properly, since the parent setup must be executed on the child every time the child class is reloaded. - -Usage and help: -http://blog.evanweaver.com/articles/2006/06/02/has_many_polymorphs - -Also see the source code, although it's probably not going to be super helpful to you. - -Changelog: - -22. api change; prefix on methods is now singular when using :rename_individual_collections -21. add configuration option to cache polymorphic classes in development mode -20. collection methods (push, delete, clear) now on individual collections -19.2. disjoint collection sides bugfix, don't raise on new records -19.1. double classify bugfix -19. large changes to properly support double polymorphism -18.2. bugfix to make sure the type gets checked on doubly polymorphic parents -18.1. bugfix for sqlite3 child attribute retrieval -18. bugfix for instantiating attributes of namespaced models -17.1. bugfix for double polymorphic relationships -17. double polymorphic relationships (includes new API method) -16. namespaced model support -15. bugfix for postgres and mysql under 1.1.6; refactored tests (thanks hildofur); properly handles legacy table names set with set_table_name() -14. sti support added (use the child class names, not the base class) -13. bug regarding table names with underscores in SQL query fixed -12.1. license change -12. file_column bug fixed -11. tests written; after_find and after_initialize now correctly called -10. bugfix -9. rollback -8. SQL performance enhancements added -7. rewrote singletons as full-fledged proxy class so that marshalling works (e.g. in the session) -6. caching added -5. fixed dependency reloading problem in development mode -4. license change -3. added :dependent support on the join table -1-2. no changelog - -Known problems: - -1. Plugin's test fixtures do not load properly for non-edge postgres, invalidating the tests. -2. quote_value() hack is stupid. \ No newline at end of file diff --git a/tracks/vendor/plugins/has_many_polymorphs/init.rb b/tracks/vendor/plugins/has_many_polymorphs/init.rb deleted file mode 100644 index 55b471e4..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/init.rb +++ /dev/null @@ -1 +0,0 @@ -require 'has_many_polymorphs' diff --git a/tracks/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs.rb b/tracks/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs.rb deleted file mode 100644 index b11502cc..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/lib/has_many_polymorphs.rb +++ /dev/null @@ -1,581 +0,0 @@ - -# self-referential, polymorphic has_many :through plugin -# http://blog.evanweaver.com/articles/2006/06/02/has_many_polymorphs -# operates via magic dust, and courage - -if defined? Rails::Configuration - class Rails::Configuration - def has_many_polymorphs_cache_classes= *args - ::ActiveRecord::Associations::ClassMethods.has_many_polymorphs_cache_classes = *args - end - end -end - -module ActiveRecord - - if ENV['RAILS_ENV'] =~ /development|test/ and ENV['USER'] == 'eweaver' - # enable this condition to get awesome association debugging - # you will get a folder "generated_models" in the current dir containing valid Ruby files - # explaining all ActiveRecord relationships set up by the plugin, as well as listing the - # line in the plugin that made each particular macro call - class << Base - COLLECTION_METHODS = [:belongs_to, :has_many, :has_and_belongs_to_many, :has_one].each do |method_name| - alias_method "original_#{method_name}".to_sym, method_name - undef_method method_name - end - - unless defined? GENERATED_CODE_DIR - # automatic code generation for debugging... bitches - GENERATED_CODE_DIR = "generated_models" - system "rm -rf #{GENERATED_CODE_DIR}" - Dir.mkdir GENERATED_CODE_DIR - - alias :original_method_missing :method_missing - def method_missing(method_name, *args, &block) - if COLLECTION_METHODS.include? method_name.to_sym - Dir.chdir GENERATED_CODE_DIR do - filename = "#{ActiveRecord::Associations::ClassMethods.demodulate(self.name.underscore)}.rb" - contents = File.open(filename).read rescue "\nclass #{self.name}\n\nend\n" - line = caller[1][/\:(\d+)\:/, 1] - contents[-5..-5] = "\n #{method_name} #{args[0..-2].inspect[1..-2]},\n #{args[-1].inspect[1..-2].gsub(" :", "\n :").gsub("=>", " => ")}\n#{ block ? " #{block.inspect.sub(/\@.*\//, '@')}\n" : ""} # called from line #{line}\n\n" - File.open(filename, "w") do |file| - file.puts contents - end - end - # doesn't handle blocks - self.send("original_#{method_name}", *args, &block) - else - self.send(:original_method_missing, method_name, *args, &block) - end - end - end - end - - # and we want to track the reloader's shenanigans - (::Dependencies.log_activity = true) rescue nil - end - - module Associations - module ClassMethods - mattr_accessor :has_many_polymorphs_cache_classes - - def acts_as_double_polymorphic_join opts - raise RuntimeError, "Couldn't understand #{opts.inspect} options in acts_as_double_polymorphic_join. Please only specify the two relationships and their member classes; there are no options to set. " unless opts.length == 2 - - join_name = self.name.tableize.to_sym - opts.each do |polymorphs, children| - parent_hash_key = (opts.keys - [polymorphs]).first # parents are the entries in the _other_ children array - - begin - parent_foreign_key = self.reflect_on_association(parent_hash_key.to_s.singularize.to_sym).primary_key_name - rescue NoMethodError - raise RuntimeError, "Couldn't find 'belongs_to' association for :#{parent_hash_key.to_s.singularize} in #{self.name}." unless parent_foreign_key - end - - parents = opts[parent_hash_key] - conflicts = (children & parents) # set intersection - parents.each do |parent_name| - - parent_class = parent_name.to_s.classify.constantize - reverse_polymorph = parent_hash_key.to_s.singularize - polymorph = polymorphs.to_s.singularize - - parent_class.send(:has_many_polymorphs, - polymorphs, {:double => true, - :from => children, - :as => parent_hash_key.to_s.singularize.to_sym, - :through => join_name, - :dependent => :destroy, - :foreign_key => parent_foreign_key, - :foreign_type_key => parent_foreign_key.to_s.sub(/_id$/, '_type'), - :reverse_polymorph => reverse_polymorph, - :conflicts => conflicts, - :rename_individual_collections => false}) - - if conflicts.include? parent_name - # unify the alternate sides of the conflicting children - (conflicts).each do |method_name| - unless parent_class.instance_methods.include?(method_name) - parent_class.send(:define_method, method_name) do - (self.send("#{reverse_polymorph}_#{method_name}") + - self.send("#{polymorph}_#{method_name}")).freeze - end - end - end - - # unify the join model - unless parent_class.instance_methods.include?(join_name) - parent_class.send(:define_method, join_name) do - (self.send("#{join_name}_as_#{reverse_polymorph}") + - self.send("#{join_name}_as_#{polymorph}")).freeze - end - end - - end - end - end - end - - def has_many_polymorphs(polymorphs, options, &block) - options.assert_valid_keys(:from, :acts_as, :as, :through, :foreign_key, :dependent, :double, - :rename_individual_collections, :foreign_type_key, :reverse_polymorph, :conflicts) - - # the way this deals with extra parameters to the associations could use some work - options[:as] ||= options[:acts_as] ||= self.table_name.singularize.to_sym - - # foreign keys follow the table name, not the class name in Rails 2.0 - options[:foreign_key] ||= "#{options[:as].to_s}_id" - - # no conflicts by default - options[:conflicts] ||= [] - - # construct the join table name - options[:through] ||= join_table((options[:as].to_s.pluralize or self.table_name), polymorphs) - if options[:reverse_polymorph] - options[:through_with_reverse_polymorph] = "#{options[:through]}_as_#{options[:reverse_polymorph]}".to_sym - else - options[:through_with_reverse_polymorph] = options[:through] - end - - options[:join_class_name] ||= options[:through].to_s.classify - - # the class must have_many on the join_table - opts = {:foreign_key => options[:foreign_key], :dependent => options[:dependent], - :class_name => options[:join_class_name]} - if options[:foreign_type_key] - opts[:conditions] = "#{options[:foreign_type_key]} = #{quote_value self.base_class.name}" - end - - has_many demodulate(options[:through_with_reverse_polymorph]), opts - - polymorph = polymorphs.to_s.singularize.to_sym - - # add the base_class method to the join_table so that STI will work transparently - inject_before_save_into_join_table(options[:join_class_name], polymorph) - - # get some reusable info - children, child_associations = {}, {} - options[:from].each do |child_plural| - children[child_plural] = child_plural.to_s.singularize.to_sym - child_associations[child_plural] = (options[:rename_individual_collections] ? "#{polymorph}_#{child_plural}".to_sym : child_plural) - end - - # get our models out of the reloadable lists, if requested - if self.has_many_polymorphs_cache_classes - klasses = [self.name, options[:join_class_name], *children.values.map{|x| x.to_s.classify}] - klasses += basify_sti_classnames(klasses).keys.to_a.compact.uniq.map{|x| x.to_s.classify} - klasses.uniq! - klasses.each {|s| logger.debug "Ejecting #{s.inspect} from the autoload lists"} - begin - Dependencies.autoloaded_constants -= klasses - Dependencies.explicitly_unloadable_constants -= klasses - rescue NoMethodError - raise "Rails 1.2.0 or later is required to set config.has_many_polymorphs_cache_classes = true" - end - end - - # auto-inject individually named associations for the children into the join model - create_virtual_associations_for_join_to_individual_children(children, polymorph, options) - - # iterate through the polymorphic children, running the parent class's :has_many on each one - create_has_many_through_associations_for_parent_to_children(children, child_associations, polymorphs, polymorph, options) - - # auto-inject the regular polymorphic associations into the child classes - create_has_many_through_associations_for_children_to_parent(children, polymorph, options) - - create_general_collection_association_for_parent(polymorphs, polymorph, basify_sti_classnames(children), options, &block) - end - - def self.demodulate(s) - s.to_s.gsub('/', '_').to_sym - end - - protected - - def demodulate(s) - ActiveRecord::Associations::ClassMethods.demodulate(s) - end - - def basify_sti_classnames(hash) - # this blows - result = {} - hash.each do |plural, singular| - klass = plural.to_s.classify.constantize - if klass != klass.base_class - result[klass.base_class.table_name.to_sym] = klass.base_class.table_name.singularize.to_sym - else - result[plural] = singular - end - end - result - end - - def inject_before_save_into_join_table(join_class_name, polymorph) - sti_hook = "sti_class_rewrite" - rewrite_procedure = %[ - self.send(:#{polymorph}_type=, self.#{polymorph}_type.constantize.base_class.name) - ] - - # this also blows, and should be abstracted. alias_method_chain is not enough. - join_class_name.constantize.class_eval %[ - unless instance_methods.include? "before_save_with_#{sti_hook}" - if instance_methods.include? "before_save" - alias_method :before_save_without_#{sti_hook}, :before_save - def before_save_with_#{sti_hook} - before_save_without_#{sti_hook} - #{rewrite_procedure} - end - else - def before_save_with_#{sti_hook} - #{rewrite_procedure} - end - end - alias_method :before_save, :before_save_with_#{sti_hook} - end - ] - - end - - def create_virtual_associations_for_join_to_individual_children(children, polymorph, options) - children.each do |child_plural, child| - options[:join_class_name].constantize.instance_eval do - - association_name = child.to_s - association_name += "_as_#{polymorph}" if options[:conflicts].include?(child_plural) - association = demodulate(association_name) - - opts = {:class_name => child.to_s.classify, - :foreign_key => "#{polymorph}_id" } - - unless self.reflect_on_all_associations.map(&:name).include? association - belongs_to association, opts - end - - end - end - end - - def create_has_many_through_associations_for_children_to_parent(children, polymorph, options) - children.each do |child_plural, child| - - if child == options[:as] - raise RuntimeError, "You can't have a self-referential polymorphic has_many :through without renaming the non-polymorphic foreign key in the join model." - end - - parent = self - child.to_s.classify.constantize.instance_eval do - - # this shouldn't be called at all during doubles; there is no way to traverse to a - # double polymorphic parent (XXX is that right?) - unless options[:double] or options[:conflicts].include? self.name.tableize.to_sym - begin - require_dependency parent.name.underscore # XXX why is this here? - rescue MissingSourceFile - end - - # the join table - through = demodulate(options[:through_with_reverse_polymorph]).to_s - through += "_as_child" if parent == self - through = through.to_sym - - has_many through, :as => polymorph, - :class_name => options[:through].to_s.classify, - :dependent => options[:dependent] - - association = options[:as].to_s.pluralize - association += "_of_#{polymorph.to_s.pluralize}" if options[:rename_individual_collections] # XXX check this - - # the polymorphic parent association - has_many association.to_sym, :through => through, - :class_name => parent.name, - :source => options[:as], - :foreign_key => options[:foreign_key] - end - - end - end - end - - def create_has_many_through_associations_for_parent_to_children(children, child_associations, polymorphs, polymorph, options) - children.each do |child_plural, child| - #puts ":source => #{child}" - association = demodulate(child_associations[child_plural]).to_s - source = demodulate(child).to_s - - if options[:conflicts].include? child_plural - # XXX what? - association = "#{polymorph}_#{association}" if options[:conflicts].include? self.name.tableize.to_sym - source += "_as_#{polymorph}" - end - - # activerecord is broken when you try to anonymously extend an association in a namespaced model, - extension = self.class_eval %[ - module #{association.classify + "AssociationExtension"} - def push *args - proxy_owner.send(:#{polymorphs}).send(:push, *args).select{|x| x.is_a? #{child.to_s.classify}} - end - alias :<< :push - def delete *args - proxy_owner.send(:#{polymorphs}).send(:delete, *args) - end - def clear - proxy_owner.send(:#{polymorphs}).send(:clear, #{child.to_s.classify}) - end - self # required - end] - - has_many association.to_sym, :through => demodulate(options[:through_with_reverse_polymorph]), - :source => source.to_sym, - :conditions => ["#{options[:join_class_name].constantize.table_name}.#{polymorph}_type = ?", child.to_s.classify.constantize.base_class.name], - :extend => extension - - end - end - - def create_general_collection_association_for_parent(collection_name, polymorph, children, options, &block) - # we need to explicitly rename all the columns because we are fetching all the children objects at once. - # if multiple objects have a 'title' column, for instance, there will be a collision and we will potentially - # lose data. if we alias the fields and then break them up later, there are no collisions. - join_model = options[:through].to_s.classify.constantize - - # figure out what fields we wanna grab - select_fields = [] - children.each do |plural, singular| - klass = plural.to_s.classify.constantize - klass.columns.map(&:name).each do |name| - select_fields << "#{klass.table_name}.#{name} as #{demodulate plural}_#{name}" - end - end - - # now get the join model fields - join_model.columns.map(&:name).each do |name| - select_fields << "#{join_model.table_name}.#{name} as #{join_model.table_name}_#{name}" - end - - from_table = self.table_name - left_joins = children.keys.map do |n| - klass = n.to_s.classify.constantize - "LEFT JOIN #{klass.table_name} ON #{join_model.table_name}.#{polymorph}_id = #{klass.table_name}.#{klass.primary_key} AND #{join_model.table_name}.#{polymorph}_type = '#{n.to_s.classify}'" - end - - sql_query = 'SELECT ' + select_fields.join(', ') + " FROM #{join_model.table_name}" + - "\nJOIN #{from_table} as polymorphic_parent ON #{join_model.table_name}.#{options[:foreign_key]} = polymorphic_parent.#{self.primary_key}\n" + - left_joins.join("\n") + "\nWHERE " - - if options[:foreign_type_key] - sql_query +="#{join_model.table_name}.#{options[:foreign_type_key]} = #{quote_value self.base_class.name} AND " - end - - # for sqlite3 you have to reference the left-most table in WHERE clauses or rows with NULL - # join results sometimes get silently dropped. it's stupid. - sql_query += "#{join_model.table_name}.#{options[:foreign_key]} " - #puts("Built collection property query:\n #{sql_query}") - - class_eval do - attr_accessor "#{collection_name}_cache" - cattr_accessor "#{collection_name}_options" - - define_method(collection_name) do - if collection_name_cache = instance_variable_get("@#{collection_name}_cache") - #puts("Cache hit on #{collection_name}") - collection_name_cache - else - #puts("Cache miss on #{collection_name}") - rows = connection.select_all("#{sql_query}" + (new_record? ? "IS NULL" : "= #{self.id}")) - # this gives us a hash with keys for each object type - objectified = objectify_polymorphic_array(rows, "#{join_model}", "#{polymorph}_type") - # locally cache the different object types found - # this doesn't work... yet. - objectified.each do |key, array| - instance_variable_set("@#{ActiveRecord::Associations::ClassMethods.demodulate(key)}", array) - end - proxy_object = HasManyPolymorphsProxyCollection.new(objectified[:all], self, send("#{collection_name}_options")) - (class << proxy_object; self end).send(:class_eval, &block) if block_given? - instance_variable_set("@#{collection_name}_cache", proxy_object) - end - end - - # in order not to break tests, see if we have been defined already - unless instance_methods.include? "reload_with_#{collection_name}" - define_method("reload_with_#{collection_name}") do - send("reload_without_#{collection_name}") - instance_variable_set("@#{collection_name}_cache", nil) - self - end - - alias_method "reload_without_#{collection_name}", :reload - alias_method :reload, "reload_with_#{collection_name}" - end - end - - send("#{collection_name}_options=", - options.merge(:collection_name => collection_name, - :type_key => "#{polymorph}_type", - :id_key => "#{polymorph}_id")) - -# puts("Defined the collection proxy.\n#{collection_name}\n") - end - - def join_table(a, b) - [a.to_s, b.to_s].sort.join("_").to_sym - end - - unless self.respond_to? :quote_value - # hack it in (very badly) for Rails 1.1.6 people - def quote_value s - "'#{s.inspect[1..-2]}'" - end - end - - end - - ################################################ - - # decided to leave this alone unless it becomes clear that there is some benefit - # in deriving from AssociationProxy - # - # the benefit would be custom finders on the collection, perhaps... - class HasManyPolymorphsProxyCollection < Array - - alias :array_delete :delete - alias :array_push :push - alias :count :length - - def initialize(contents, parent, options) - @parent = parent - @options = options - @join_class = options[:join_class_name].constantize - return if contents.blank? - super(contents) - end - - def push(objs, args={}) - objs = [objs] unless objs.is_a? Array - - objs.each do |obj| - data = {@options[:foreign_key] => @parent.id, - @options[:type_key] => obj.class.base_class.to_s, @options[:id_key] => obj.id} - data.merge!({@options[:foreign_type_key] => @parent.class.base_class.to_s}) if @options[:foreign_type_key] # for double polymorphs - conditions_string = data.keys.map(&:to_s).push("").join(" = ? AND ")[0..-6] - if @join_class.find(:first, :conditions => [conditions_string] + data.values).blank? - @join_class.new(data).save! - end - end - - if args[:reload] - reload - else - # we have to do this funky stuff instead of just array difference because +/.uniq returns a regular array, - # which doesn't have our special methods and configuration anymore - unless (difference = objs - collection).blank? - @parent.send("#{@options[:collection_name]}_cache=".to_sym, collection.array_push(*difference)) - end - end - - @parent.send(@options[:collection_name]) - end - - alias :<< :push - - def delete(objs, args={}) - - if objs - objs = [objs] unless objs.is_a? Array - elsif args[:clear] - objs = collection - objs = objs.select{|obj| obj.is_a? args[:klass]} if args[:klass] - else - raise RuntimeError, "Invalid delete parameters (has_many_polymorphs)." - end - - records = [] - objs.each do |obj| - records += join_records.select do |record| - record.send(@options[:type_key]) == obj.class.base_class.to_s and - record.send(@options[:id_key]) == obj.id - end - end - - reload if args[:reload] - unless records.blank? - records.map(&:destroy) - # XXX could be faster if we reversed the loops - deleted_items = collection.select do |item| - records.select {|join_record| - join_record.send(@options[:type_key]) == item.class.base_class.name and - join_record.send(@options[:id_key]) == item.id - }.length > 0 - end - # keep the cache fresh, while we're at it. see comment in .push - deleted_items.each { |item| collection.array_delete(item) } - @parent.send("#{@options[:collection_name]}_cache=", collection) - - return deleted_items unless deleted_items.empty? - end - nil - end - - def clear(klass = nil) - result = delete(nil, :clear => true, :klass => klass) - return result if result - collection - end - - def reload - # reset the cache, postponing reloading from the db until we really need it - @parent.reload - end - - private - def join_records - @parent.send(ActiveRecord::Associations::ClassMethods.demodulate(@options[:through])) - end - - def collection - @parent.send(@options[:collection_name]) - end - - end - end - - - class Base - # turns an array of hashes (db rows) into a hash consisting of :all (array of everything) and - # a hash key for each class type it finds, e.g. :posts and :comments - private - def objectify_polymorphic_array(array, join_model, type_field) - join_model = join_model.constantize - arrays_hash = {} - - array.each do |element| - klass = element["#{join_model.table_name}_#{type_field}"].constantize - association = ActiveRecord::Associations::ClassMethods.demodulate(klass.name.pluralize.underscore.downcase) - hash = {} - -# puts "Class #{klass.inspect}" -# puts "Association name: #{association.inspect}" - - element.each do |key, value| -# puts "key #{key} - value #{value.inspect}" - if key =~ /^#{association}_(.+)/ - hash[$1] = value -# puts "#{$1.inspect} assigned #{value.inspect}" - end - end - - object = klass.instantiate(hash) - - arrays_hash[:all] ||= [] - arrays_hash[association] ||= [] - arrays_hash[:all] << object - arrays_hash[association] << object - end - - arrays_hash - end - end -end - -#require 'ruby-debug' -#Debugger.start - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/aquatic/fish.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/aquatic/fish.yml deleted file mode 100644 index 713d9127..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/aquatic/fish.yml +++ /dev/null @@ -1,8 +0,0 @@ -swimmy: - id: 1 - name: Swimmy - speed: 10 -jaws: - id: 2 - name: Jaws - speed: 20 \ No newline at end of file diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/aquatic/little_whale_pupils.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/aquatic/little_whale_pupils.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/aquatic/whales.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/aquatic/whales.yml deleted file mode 100644 index be296d47..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/aquatic/whales.yml +++ /dev/null @@ -1,3 +0,0 @@ -shamu: - id: 1 - name: Shamu diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/bow_wows.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/bow_wows.yml deleted file mode 100644 index 81759008..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/bow_wows.yml +++ /dev/null @@ -1,6 +0,0 @@ -rover: - id: 1 - name: Rover -spot: - id: 2 - name: Spot \ No newline at end of file diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/cats.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/cats.yml deleted file mode 100644 index adf3ead7..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/cats.yml +++ /dev/null @@ -1,8 +0,0 @@ -chloe: - id: 1 - cat_type: Kitten - name: Chloe -alice: - id: 2 - cat_type: Kitten - name: Alice \ No newline at end of file diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/eaters_foodstuffs.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/eaters_foodstuffs.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/frogs.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/frogs.yml deleted file mode 100644 index 145700f4..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/frogs.yml +++ /dev/null @@ -1,3 +0,0 @@ -froggy: - id: 1 - name: Froggy diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/keep_your_enemies_close.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/keep_your_enemies_close.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/petfoods.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/petfoods.yml deleted file mode 100644 index bb174ea8..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/petfoods.yml +++ /dev/null @@ -1,6 +0,0 @@ -kibbles: - the_petfood_primary_key: 1 - name: Kibbles -bits: - the_petfood_primary_key: 2 - name: Bits \ No newline at end of file diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/wild_boars.yml b/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/wild_boars.yml deleted file mode 100644 index 39f12b18..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/fixtures/wild_boars.yml +++ /dev/null @@ -1,6 +0,0 @@ -puma: - id: 1 - name: Puma -jacrazy: - id: 2 - name: Jacrazy diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/fish.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/fish.rb deleted file mode 100644 index 21ca3afc..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/fish.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Aquatic::Fish < ActiveRecord::Base -# attr_accessor :after_find_test, :after_initialize_test -end - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/pupils_whale.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/pupils_whale.rb deleted file mode 100644 index ae4cbc18..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/pupils_whale.rb +++ /dev/null @@ -1,7 +0,0 @@ - -class Aquatic::PupilsWhale < ActiveRecord::Base - set_table_name "little_whale_pupils" - belongs_to :whale, :class_name => "Aquatic::Whale", :foreign_key => "whale_id" - belongs_to :aquatic_pupil, :polymorphic => true -end - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/whale.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/whale.rb deleted file mode 100644 index 698ca6d4..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/aquatic/whale.rb +++ /dev/null @@ -1,11 +0,0 @@ -# see http://dev.rubyonrails.org/ticket/5935 -module Aquatic; end -require 'aquatic/fish' -require 'aquatic/pupils_whale' - -class Aquatic::Whale < ActiveRecord::Base - has_many_polymorphs(:aquatic_pupils, :from => [:dogs, :"aquatic/fish"], - :through => "aquatic/pupils_whales") do - def blow; "result"; end - end -end diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/beautiful_fight_relationship.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/beautiful_fight_relationship.rb deleted file mode 100644 index c1935b30..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/beautiful_fight_relationship.rb +++ /dev/null @@ -1,13 +0,0 @@ - -class BeautifulFightRelationship < ActiveRecord::Base - set_table_name 'keep_your_enemies_close' - - belongs_to :enemy, :polymorphic => true - belongs_to :protector, :polymorphic => true - # polymorphic relationships with column names different from the relationship name - # are not supported by Rails - - acts_as_double_polymorphic_join :enemies => [:dogs, :kittens, :frogs], - :protectors => [:wild_boars, :kittens, :"aquatic/fish", :dogs] -end - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/cat.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/cat.rb deleted file mode 100644 index 0c99ff08..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/cat.rb +++ /dev/null @@ -1,5 +0,0 @@ -class Cat < ActiveRecord::Base - # STI base class - self.inheritance_column = 'cat_type' -end - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/dog.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/dog.rb deleted file mode 100644 index 6f2da737..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/dog.rb +++ /dev/null @@ -1,16 +0,0 @@ -class Dog < ActiveRecord::Base - attr_accessor :after_find_test, :after_initialize_test - - set_table_name "bow_wows" - - def after_find - @after_find_test = true -# puts "After find called on #{name}." - end - - def after_initialize - @after_initialize_test = true - end - -end - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/eaters_foodstuff.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/eaters_foodstuff.rb deleted file mode 100644 index d904bb16..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/eaters_foodstuff.rb +++ /dev/null @@ -1,10 +0,0 @@ - -class EatersFoodstuff < ActiveRecord::Base - belongs_to :foodstuff, :class_name => "Petfood", :foreign_key => "foodstuff_id" - belongs_to :eater, :polymorphic => true - - def before_save - self.some_attribute = 3 - end -end - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/frog.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/frog.rb deleted file mode 100644 index 5a0f4658..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/frog.rb +++ /dev/null @@ -1,4 +0,0 @@ -class Frog < ActiveRecord::Base - -end - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/kitten.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/kitten.rb deleted file mode 100644 index 2a244c03..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/kitten.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Kitten < Cat -# has_many :eaters_parents, :dependent => true, :as => 'eater' -end \ No newline at end of file diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/petfood.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/petfood.rb deleted file mode 100644 index fa8b0f91..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/petfood.rb +++ /dev/null @@ -1,21 +0,0 @@ -# see http://dev.rubyonrails.org/ticket/5935 -require 'eaters_foodstuff' -require 'petfood' -require 'cat' -module Aquatic; end -require 'aquatic/fish' -require 'dog' -require 'wild_boar' -require 'kitten' -require 'tabby' - -class Petfood < ActiveRecord::Base - set_primary_key 'the_petfood_primary_key' - has_many_polymorphs :eaters, - :from => [:dogs, :petfoods, :wild_boars, :kittens, - :tabbies, :"aquatic/fish"], - :dependent => :destroy, - :rename_individual_collections => true, - :acts_as => :foodstuff, - :foreign_key => "foodstuff_id" -end diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/tabby.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/tabby.rb deleted file mode 100644 index 3cd0f994..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/tabby.rb +++ /dev/null @@ -1,2 +0,0 @@ -class Tabby < Cat -end \ No newline at end of file diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/models/wild_boar.rb b/tracks/vendor/plugins/has_many_polymorphs/test/models/wild_boar.rb deleted file mode 100644 index 27d36a53..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/models/wild_boar.rb +++ /dev/null @@ -1,3 +0,0 @@ -class WildBoar < ActiveRecord::Base -end - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/schema.rb b/tracks/vendor/plugins/has_many_polymorphs/test/schema.rb deleted file mode 100644 index 12123532..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/schema.rb +++ /dev/null @@ -1,52 +0,0 @@ -ActiveRecord::Schema.define(:version => 0) do - create_table :petfoods, :force => true, :primary_key => :the_petfood_primary_key do |t| - t.column :name, :string - end - - create_table :bow_wows, :force => true do |t| - t.column :name, :string - end - - create_table :cats, :force => true do |t| - t.column :name, :string - t.column :cat_type, :string - end - - create_table :frogs, :force => true do |t| - t.column :name, :string - end - - create_table :wild_boars, :force => true do |t| - t.column :name, :string - end - - create_table :eaters_foodstuffs, :force => true do |t| - t.column :foodstuff_id, :integer - t.column :eater_id, :integer - t.column :some_attribute, :integer, :default => 0 - t.column :eater_type, :string - end - - create_table :fish, :force => true do |t| - t.column :name, :string - t.column :speed, :integer - end - - create_table :whales, :force => true do |t| - t.column :name, :string - end - - create_table :little_whale_pupils, :force => true do |t| - t.column :whale_id, :integer - t.column :aquatic_pupil_id, :integer - t.column :aquatic_pupil_type, :string - end - - create_table :keep_your_enemies_close, :force => true do |t| - t.column :enemy_id, :integer - t.column :enemy_type, :string - t.column :protector_id, :integer - t.column :protector_type, :string - end - -end diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/test_helper.rb b/tracks/vendor/plugins/has_many_polymorphs/test/test_helper.rb deleted file mode 100644 index 712b6926..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/test_helper.rb +++ /dev/null @@ -1,23 +0,0 @@ -require 'pathname' -# default test helper -begin - require File.dirname(__FILE__) + '/../../../../test/test_helper' -rescue LoadError - require '~/projects/miscellaneous/cookbook/test/test_helper' -end - -Inflector.inflections {|i| i.irregular 'fish', 'fish' } - -# fixtures -$LOAD_PATH.unshift(Test::Unit::TestCase.fixture_path = File.dirname(__FILE__) + "/fixtures/") -# models -$LOAD_PATH.unshift("#{Pathname.new(__FILE__).dirname.to_s}/models") - -class Test::Unit::TestCase - self.use_transactional_fixtures = true # must stay true for tests to run on postgres or sqlite3 - self.use_instantiated_fixtures = false -end - -# test schema -load(File.dirname(__FILE__) + "/schema.rb") - diff --git a/tracks/vendor/plugins/has_many_polymorphs/test/unit/polymorph_test.rb b/tracks/vendor/plugins/has_many_polymorphs/test/unit/polymorph_test.rb deleted file mode 100644 index 750a9295..00000000 --- a/tracks/vendor/plugins/has_many_polymorphs/test/unit/polymorph_test.rb +++ /dev/null @@ -1,487 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class PolymorphTest < Test::Unit::TestCase - - fixtures :cats, :bow_wows, :frogs, :wild_boars, :eaters_foodstuffs, :petfoods, - :"aquatic/fish", :"aquatic/whales", :"aquatic/little_whale_pupils", - :keep_your_enemies_close - require 'beautiful_fight_relationship' - - # to-do: finder queries on the collection - # order-mask column on the join table for polymorphic order - # rework load order so you could push and pop without ever loading the whole collection - # so that limit works in a sane way - - def setup - @kibbles = Petfood.find(1) - @bits = Petfood.find(2) - @shamu = Aquatic::Whale.find(1) - @swimmy = Aquatic::Fish.find(1) - @rover = Dog.find(1) - @spot = Dog.find(2) - @puma = WildBoar.find(1) - @chloe = Kitten.find(1) - @alice = Kitten.find(2) - @froggy = Frog.find(1) - - @join_count = EatersFoodstuff.count - @l = @kibbles.eaters.length - @m = @bits.eaters.count - end - - def test_all_relationship_validities - # q = [] - # ObjectSpace.each_object(Class){|c| q << c if c.ancestors.include? ActiveRecord::Base } - # q.each{|c| puts "#{c.name}.reflect_on_all_associations.map &:check_validity! "} - Petfood.reflect_on_all_associations.map &:check_validity! - Tabby.reflect_on_all_associations.map &:check_validity! - Kitten.reflect_on_all_associations.map &:check_validity! - Dog.reflect_on_all_associations.map &:check_validity! - Aquatic::Fish.reflect_on_all_associations.map &:check_validity! - EatersFoodstuff.reflect_on_all_associations.map &:check_validity! - WildBoar.reflect_on_all_associations.map &:check_validity! - Frog.reflect_on_all_associations.map &:check_validity! - Aquatic::Whale.reflect_on_all_associations.map &:check_validity! - Cat.reflect_on_all_associations.map &:check_validity! - Aquatic::PupilsWhale.reflect_on_all_associations.map &:check_validity! - BeautifulFightRelationship.reflect_on_all_associations.map &:check_validity! - end - - def test_assignment - assert @kibbles.eaters.blank? - assert @kibbles.eaters.push(Cat.find_by_name('Chloe')) - assert_equal @l += 1, @kibbles.eaters.count - - @kibbles.reload - assert_equal @l, @kibbles.eaters.count - - end - - def test_duplicate_assignment - # try to add a duplicate item - @kibbles.eaters.push(@alice) - assert @kibbles.eaters.include?(@alice) - @kibbles.eaters.push(@alice) - assert_equal @l + 1, @kibbles.eaters.count - assert_equal @join_count + 1, EatersFoodstuff.count - - @kibbles.reload - assert_equal @l + 1, @kibbles.eaters.count - assert_equal @join_count + 1, EatersFoodstuff.count - end - - def test_create_and_push - assert @kibbles.eaters.push(@spot) - assert_equal @l += 1, @kibbles.eaters.count - assert @kibbles.eaters << @rover - assert @kibbles.eaters << Kitten.create(:name => "Miranda") - assert_equal @l += 2, @kibbles.eaters.length - - @kibbles.reload - assert_equal @l, @kibbles.eaters.length - - # test that ids and new flags were set appropriately - assert_not_nil @kibbles.eaters[0].id - assert !@kibbles.eaters[1].new_record? - end - - def test_reload - assert @kibbles.reload - assert @kibbles.eaters.reload - end - - def test_add_join_record - assert_equal Kitten, @chloe.class - assert @join_record = EatersFoodstuff.new(:foodstuff_id => @bits.id, :eater_id => @chloe.id, :eater_type => @chloe.class.name ) - assert @join_record.save! - assert @join_record.id - assert_equal @join_count + 1, EatersFoodstuff.count - - # has the parent changed if we don't reload? - assert_equal @m, @bits.eaters.count - - # if we do reload, is the new association there? - # XXX no, because TestCase breaks reload. it works fine in the app. - - assert_equal Petfood, @bits.eaters.reload.class - assert_equal @m + 1, @bits.eaters.count - assert @bits.eaters.include?(@chloe) - -# puts "XXX #{EatersFoodstuff.count}" - - end - - def test_add_unsaved - # add an unsaved item - assert @bits.eaters << Kitten.new(:name => "Bridget") - assert_nil Kitten.find_by_name("Bridget") - assert_equal @m + 1, @bits.eaters.count - - assert @bits.save - @bits.reload - assert_equal @m + 1, @bits.eaters.count - - end - - def test_self_reference - assert @kibbles.eaters << @bits - assert_equal @l += 1, @kibbles.eaters.count - assert @kibbles.eaters.include?(@bits) - @kibbles.reload - assert @kibbles.foodstuffs_of_eaters.blank? - - @bits.reload - assert @bits.foodstuffs_of_eaters.include?(@kibbles) - assert_equal [@kibbles], @bits.foodstuffs_of_eaters - end - - def test_remove - assert @kibbles.eaters << @chloe - @kibbles.reload - assert @kibbles.eaters.delete(@kibbles.eaters[0]) - assert_equal @l, @kibbles.eaters.count - end - - def test_destroy - assert @kibbles.eaters.push(@chloe) - @kibbles.reload - assert @kibbles.eaters.length > 0 - assert @kibbles.eaters[0].destroy - @kibbles.reload - assert_equal @l, @kibbles.eaters.count - end - - def test_clear - @kibbles.eaters << [@chloe, @spot, @rover] - @kibbles.reload - assert_equal 3, @kibbles.eaters.clear.size - assert @kibbles.eaters.blank? - @kibbles.reload - assert @kibbles.eaters.blank? - assert_equal 0, @kibbles.eaters.clear.size - end - - def test_individual_collections - assert @kibbles.eaters.push(@chloe) - # check if individual collections work - assert_equal @kibbles.eater_kittens.length, 1 - assert @kibbles.eater_dogs - assert 1, @rover.eaters_foodstuffs.count - end - - def test_invididual_collections_push - assert_equal [@chloe], (@kibbles.eater_kittens << @chloe) - @kibbles.reload - assert @kibbles.eaters.include?(@chloe) - assert @kibbles.eater_kittens.include?(@chloe) - assert !@kibbles.eater_dogs.include?(@chloe) - end - - def test_invididual_collections_delete - @kibbles.eaters << [@chloe, @spot, @rover] - @kibbles.reload - assert_equal [@chloe], @kibbles.eater_kittens.delete(@chloe) - assert @kibbles.eater_kittens.empty? - assert !@kibbles.eater_kittens.delete(@chloe) - - @kibbles.reload - assert @kibbles.eater_kittens.empty? - assert @kibbles.eater_dogs.include?(@spot) - end - - def test_invididual_collections_clear - @kibbles.eaters << [@chloe, @spot, @rover] - @kibbles.reload - assert_equal [@chloe], @kibbles.eater_kittens.clear - assert @kibbles.eater_kittens.empty? - assert_equal 2, @kibbles.eaters.size - @kibbles.reload - assert @kibbles.eater_kittens.empty? - assert_equal 2, @kibbles.eaters.size - assert !@kibbles.eater_kittens.include?(@chloe) - assert !@kibbles.eaters.include?(@chloe) - end - - def test_childrens_individual_collections - assert Cat.find_by_name('Chloe').eaters_foodstuffs - assert @kibbles.eaters_foodstuffs - end - - def test_self_referential_join_tables - # check that the self-reference join tables go the right ways - assert_equal @l, @kibbles.eaters_foodstuffs.count - assert_equal @kibbles.eaters_foodstuffs.count, @kibbles.eaters_foodstuffs_as_child.count - end - - def test_dependent - assert @kibbles.eaters << @chloe - @kibbles.reload - - # delete ourself and see if :dependent was obeyed - dependent_rows = @kibbles.eaters_foodstuffs - assert_equal dependent_rows.length, @kibbles.eaters.count - @join_count = EatersFoodstuff.count - - @kibbles.destroy - assert_equal @join_count - dependent_rows.length, EatersFoodstuff.count - assert_equal 0, EatersFoodstuff.find(:all, :conditions => ['foodstuff_id = ?', 1] ).length - end - - def test_normal_callbacks - assert @rover.respond_to?(:after_initialize) - assert @rover.respond_to?(:after_find) - - assert @rover.after_initialize_test - assert @rover.after_find_test - end - - def test_our_callbacks - assert 0, @bits.eaters.count - assert @bits.eaters.push(@rover) - @bits.save - -# puts "Testing callbacks." - @bits2 = Petfood.find_by_name("Bits") - @bits.reload - - assert rover = @bits2.eaters.select { |x| x.name == "Rover" }[0] - assert rover.after_initialize_test - assert rover.after_find_test -# puts "Done." - - end - - def test_number_of_join_records - assert EatersFoodstuff.create(:foodstuff_id => 1, :eater_id => 1, :eater_type => "Cat") - @join_count = EatersFoodstuff.count - assert @join_count > 0 - end - - def test_number_of_regular_records - dogs = Dog.count - assert Dog.new(:name => "Auggie").save! - assert dogs + 1, Dog.count - end - - def test_attributes_come_through_when_child_has_underscore_in_table_name - @join_record = EatersFoodstuff.new(:foodstuff_id => @bits.id, :eater_id => @puma.id, :eater_type => @puma.class.name) - @join_record.save! - @bits.eaters.reload - - assert_equal 'Puma', @puma.name - assert_equal 'Puma', @bits.eaters.first.name - end - - def test_before_save_on_join_table_is_not_clobbered_by_sti_base_class_fix - assert @kibbles.eaters << @chloe - assert_equal 3, @kibbles.eaters_foodstuffs.first.some_attribute - end - - def test_creating_namespaced_relationship - assert @shamu.aquatic_pupils.empty? - @shamu.aquatic_pupils << @swimmy - assert_equal 1, @shamu.aquatic_pupils.length - @shamu.reload - assert_equal 1, @shamu.aquatic_pupils.length - end - - - def test_namespaced_polymorphic_collection - @shamu.aquatic_pupils << @swimmy - assert @shamu.aquatic_pupils.include?(@swimmy) - @shamu.reload - assert @shamu.aquatic_pupils.include?(@swimmy) - - @shamu.aquatic_pupils << @spot - assert @shamu.dogs.include?(@spot) - assert @shamu.aquatic_pupils.include?(@swimmy) - assert_equal @swimmy, @shamu.aquatic_fish.first - assert_equal 10, @shamu.aquatic_fish.first.speed - end - - def test_deleting_namespaced_relationship - @shamu.aquatic_pupils << @swimmy - @shamu.aquatic_pupils << @spot - - @shamu.reload - @shamu.aquatic_pupils.delete @spot - assert !@shamu.dogs.include?(@spot) - assert !@shamu.aquatic_pupils.include?(@spot) - assert_equal 1, @shamu.aquatic_pupils.length - end - - def test_unrenamed_parent_of_namespaced_child - @shamu.aquatic_pupils << @swimmy - assert_equal [@shamu], @swimmy.whales - end - - def test_empty_double_collections - assert @puma.enemies.empty? - assert @froggy.protectors.empty? - assert @alice.enemies.empty? - assert @spot.protectors.empty? - assert @alice.beautiful_fight_relationships_as_enemy.empty? - assert @alice.beautiful_fight_relationships_as_protector.empty? - assert @alice.beautiful_fight_relationships.empty? - end - - def test_double_collection_assignment - @alice.enemies << @spot - @alice.reload - @spot.reload - assert @spot.protectors.include?(@alice) - assert @alice.enemies.include?(@spot) - assert !@alice.protectors.include?(@alice) - assert_equal 1, @alice.beautiful_fight_relationships_as_protector.size - assert_equal 0, @alice.beautiful_fight_relationships_as_enemy.size - assert_equal 1, @alice.beautiful_fight_relationships.size - - # self reference - assert_equal 1, @alice.enemies.length - @alice.enemies.push @alice - assert @alice.enemies.include?(@alice) - assert_equal 2, @alice.enemies.length - @alice.reload - assert_equal 2, @alice.beautiful_fight_relationships_as_protector.size - assert_equal 1, @alice.beautiful_fight_relationships_as_enemy.size - assert_equal 3, @alice.beautiful_fight_relationships.size - end - - def test_double_collection_deletion - @alice.enemies << @spot - @alice.reload - assert @alice.enemies.include?(@spot) - @alice.enemies.delete(@spot) - assert !@alice.enemies.include?(@spot) - assert @alice.enemies.empty? - @alice.reload - assert !@alice.enemies.include?(@spot) - assert @alice.enemies.empty? - assert_equal 0, @alice.beautiful_fight_relationships.size - end - - def test_double_collection_deletion_from_opposite_side - @alice.protectors << @puma - @alice.reload - assert @alice.protectors.include?(@puma) - @alice.protectors.delete(@puma) - assert !@alice.protectors.include?(@puma) - assert @alice.protectors.empty? - @alice.reload - assert !@alice.protectors.include?(@puma) - assert @alice.protectors.empty? - assert_equal 0, @alice.beautiful_fight_relationships.size - end - - def test_individual_collections_created_for_double_relationship - assert @alice.dogs.empty? - @alice.enemies << @spot - - assert @alice.enemies.include?(@spot) - assert !@alice.kittens.include?(@alice) - - assert !@alice.dogs.include?(@spot) - @alice.reload - assert @alice.dogs.include?(@spot) - assert !WildBoar.find(@alice.id).dogs.include?(@spot) # make sure the parent type is checked - end - - def test_individual_collections_created_for_double_relationship_from_opposite_side - assert @alice.wild_boars.empty? - @alice.protectors << @puma - - assert @alice.protectors.include?(@puma) - assert !@alice.wild_boars.include?(@puma) - @alice.reload - assert @alice.wild_boars.include?(@puma) - - assert !Dog.find(@alice.id).wild_boars.include?(@puma) # make sure the parent type is checked - end - - def test_self_referential_individual_collections_created_for_double_relationship - @alice.enemies << @alice - @alice.reload - assert @alice.enemy_kittens.include?(@alice) - assert @alice.protector_kittens.include?(@alice) - assert @alice.kittens.include?(@alice) - assert_equal 2, @alice.kittens.size - - @alice.enemies << (@chloe = Kitten.find_by_name('Chloe')) - @alice.reload - assert @alice.enemy_kittens.include?(@chloe) - assert !@alice.protector_kittens.include?(@chloe) - assert @alice.kittens.include?(@chloe) - assert_equal 3, @alice.kittens.size - end - - def test_child_of_polymorphic_join_can_reach_parent - @alice.enemies << @spot - @alice.reload - assert @spot.protectors.include?(@alice) - end - - def test_double_collection_deletion_from_child_polymorphic_join - @alice.enemies << @spot - @spot.protectors.delete(@alice) - assert !@spot.protectors.include?(@alice) - @alice.reload - assert !@alice.enemies.include?(@spot) - BeautifulFightRelationship.create(:protector_id => 2, :protector_type => "Dog", :enemy_id => @spot.id, :enemy_type => @spot.class.name) - @alice.enemies << @spot - @spot.protectors.delete(@alice) - assert !@spot.protectors.include?(@alice) - end - - def test_hmp_passed_block_manipulates_proxy_class - assert_equal "result", @shamu.aquatic_pupils.blow - assert_raises(NoMethodError) { @kibbles.eaters.blow } - end - - def test_collection_query_on_unsaved_record - assert Dog.new.enemies.empty? - assert Dog.new.foodstuffs_of_eaters.empty? - end - - def test_double_invididual_collections_push - assert_equal [@chloe], (@spot.protector_kittens << @chloe) - @spot.reload - assert @spot.protectors.include?(@chloe) - assert @spot.protector_kittens.include?(@chloe) - assert !@spot.protector_dogs.include?(@chloe) - - assert_equal [@froggy], (@spot.frogs << @froggy) - @spot.reload - assert @spot.enemies.include?(@froggy) - assert @spot.frogs.include?(@froggy) - assert !@spot.enemy_dogs.include?(@froggy) - end - - def test_double_invididual_collections_delete - @spot.protectors << [@chloe, @puma] - @spot.reload - assert_equal [@chloe], @spot.protector_kittens.delete(@chloe) - assert @spot.protector_kittens.empty? - assert !@spot.protector_kittens.delete(@chloe) - - @spot.reload - assert @spot.protector_kittens.empty? - assert @spot.wild_boars.include?(@puma) - end - - def test_double_invididual_collections_clear - @spot.protectors << [@chloe, @puma, @alice] - @spot.reload - assert_equal [@chloe, @alice], @spot.protector_kittens.clear.sort_by(&:id) - assert @spot.protector_kittens.empty? - assert_equal 1, @spot.protectors.size - @spot.reload - assert @spot.protector_kittens.empty? - assert_equal 1, @spot.protectors.size - assert !@spot.protector_kittens.include?(@chloe) - assert !@spot.protectors.include?(@chloe) - assert !@spot.protector_kittens.include?(@alice) - assert !@spot.protectors.include?(@alice) - end - - -end diff --git a/tracks/vendor/plugins/memory_test_fix/README b/tracks/vendor/plugins/memory_test_fix/README deleted file mode 100644 index 7972efdd..00000000 --- a/tracks/vendor/plugins/memory_test_fix/README +++ /dev/null @@ -1,35 +0,0 @@ -MemoryTestFix -============= - -A simple fix to run tests with sqlite. From example at - -http://blog.seagul.co.uk/articles/2006/02/08/in-memory-sqlite-database-for-rails-testing - -In your database.yml, use - - test: - adapter: sqlite3 - database: ":memory:" - -It runs much faster! - -You can also adjust the verbosity of the output: - -test: - adapter: sqlite3 - database: ":memory:" - verbosity: silent - -== Authors - -Chris Roos - -Adapted by Geoffrey Grosenbach, http://nubyonrails.com - -Verbosity patch by Kakutani Shintaro - -== Changelog - -* Updated to look for either so it works with Rails 1.2 and also older versions -* Updated to use ActiveRecord::ConnectionAdapters::SQLite3Adapter for Rails 1.2 - diff --git a/tracks/vendor/plugins/memory_test_fix/Rakefile b/tracks/vendor/plugins/memory_test_fix/Rakefile deleted file mode 100644 index 1ca2d969..00000000 --- a/tracks/vendor/plugins/memory_test_fix/Rakefile +++ /dev/null @@ -1,22 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the memory_test_fix plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the memory_test_fix plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'MemoryTestFix' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/tracks/vendor/plugins/memory_test_fix/about.yml b/tracks/vendor/plugins/memory_test_fix/about.yml deleted file mode 100644 index d11ce0a9..00000000 --- a/tracks/vendor/plugins/memory_test_fix/about.yml +++ /dev/null @@ -1,7 +0,0 @@ -author: Chris Roos -summary: Makes SQLite3 memory tests possible by preloading the schema. -homepage: http://blog.seagul.co.uk/articles/2006/02/08/in-memory-sqlite-database-for-rails-testing -plugin: http://topfunky.net/svn/plugins/memory_test_fix -license: MIT -version: 0.1 -rails_version: 1.1+ diff --git a/tracks/vendor/plugins/memory_test_fix/init.rb b/tracks/vendor/plugins/memory_test_fix/init.rb deleted file mode 100644 index 838b8bb6..00000000 --- a/tracks/vendor/plugins/memory_test_fix/init.rb +++ /dev/null @@ -1,2 +0,0 @@ - -require 'memory_test_fix' diff --git a/tracks/vendor/plugins/memory_test_fix/lib/memory_test_fix.rb b/tracks/vendor/plugins/memory_test_fix/lib/memory_test_fix.rb deleted file mode 100644 index 05e17b8c..00000000 --- a/tracks/vendor/plugins/memory_test_fix/lib/memory_test_fix.rb +++ /dev/null @@ -1,42 +0,0 @@ - -# Update: Looks for the SQLite and SQLite3 adapters for -# compatibility with Rails 1.2.2 and also older versions. -def in_memory_database? - if ENV["RAILS_ENV"] == "test" and Rails::Configuration.new.database_configuration['test']['database'] == ':memory:' - begin - if ActiveRecord::Base.connection.class == ActiveRecord::ConnectionAdapters::SQLite3Adapter - return true - end - rescue NameError => e - if ActiveRecord::Base.connection.class == ActiveRecord::ConnectionAdapters::SQLiteAdapter - return true - end - end - end - false -end - -def verbosity - Rails::Configuration.new.database_configuration['test']['verbosity'] -end - -def inform_using_in_memory - puts "Creating sqlite :memory: database" -end - -if in_memory_database? - load_schema = lambda { - #load "#{RAILS_ROOT}/db/schema.rb" # use db agnostic schema by default - ActiveRecord::Migrator.up('db/migrate') # use migrations - } - case verbosity - when "silent" - silence_stream(STDOUT, &load_schema) - when "quiet" - inform_using_in_memory - silence_stream(STDOUT, &load_schema) - else - inform_using_in_memory - load_schema.call - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/LICENSE-2.0.txt b/tracks/vendor/plugins/openid_consumer_plugin/LICENSE similarity index 100% rename from tracks/vendor/plugins/selenium-on-rails/LICENSE-2.0.txt rename to tracks/vendor/plugins/openid_consumer_plugin/LICENSE diff --git a/tracks/vendor/plugins/openid_consumer_plugin/README b/tracks/vendor/plugins/openid_consumer_plugin/README new file mode 100644 index 00000000..a5a01bfd --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/README @@ -0,0 +1,22 @@ +OpenID Consumer +=============== + +Enable OpenID authentication and profile exchange from your application. + +PRE-REQUISITES +-------------- + +* JanRain's Yadis and OpenID 1.2 libraries in Ruby. + * These can be obtained using 'gem install ruby-openid' + + +INSTALLATION +------------ + +To install you need to create a migration and add a controller. + + ./script/generate open_id_migration add_open_id_tables + ./script/generate open_id_consumer_controller open_id + +This can be used well in conjunction with a login system such as ActsAsAuthenticated + diff --git a/tracks/vendor/plugins/openid_consumer_plugin/Rakefile b/tracks/vendor/plugins/openid_consumer_plugin/Rakefile new file mode 100644 index 00000000..79ede457 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/Rakefile @@ -0,0 +1,39 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +require 'rake' +require 'rake/testtask' +require 'rake/rdoctask' + +desc 'Default: run unit tests.' +task :default => :test + +desc 'Test the open_id_consumer plugin.' +Rake::TestTask.new(:test) do |t| + t.libs << 'lib' + t.pattern = 'test/**/*_test.rb' + t.verbose = true +end + +desc 'Generate documentation for the open_id_consumer plugin.' +Rake::RDocTask.new(:rdoc) do |rdoc| + rdoc.rdoc_dir = 'rdoc' + rdoc.title = 'OpenIdConsumer' + rdoc.options << '--line-numbers' << '--inline-source' + rdoc.rdoc_files.include('README') + rdoc.rdoc_files.include('lib/**/*.rb') +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/open_id_consumer_controller_generator.rb b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/open_id_consumer_controller_generator.rb new file mode 100644 index 00000000..ad63aaaa --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/open_id_consumer_controller_generator.rb @@ -0,0 +1,86 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +class OpenIdConsumerControllerGenerator < Rails::Generator::NamedBase + attr_reader :controller_name, + :controller_class_path, + :controller_file_path, + :controller_class_nesting, + :controller_class_nesting_depth, + :controller_class_name, + :controller_singular_name, + :controller_plural_name + alias_method :controller_file_name, :controller_singular_name + alias_method :controller_table_name, :controller_plural_name + + def initialize(runtime_args, runtime_options = {}) + runtime_args << 'open_id' if runtime_args.empty? + super + + # Take controller name from the next argument. Default to the pluralized model name. + @controller_name = args.shift + @controller_name ||= ActiveRecord::Base.pluralize_table_names ? @name.pluralize : @name + + base_name, @controller_class_path, @controller_file_path, @controller_class_nesting, @controller_class_nesting_depth = extract_modules(@controller_name) + @controller_class_name_without_nesting, @controller_singular_name, @controller_plural_name = inflect_names(base_name) + + if @controller_class_nesting.empty? + @controller_class_name = @controller_class_name_without_nesting + else + @controller_class_name = "#{@controller_class_nesting}::#{@controller_class_name_without_nesting}" + end + end + + def manifest + record do |m| + # Check for class naming collisions. + m.class_collisions controller_class_path, "#{controller_class_name}Controller", + "#{controller_class_name}Helper" + + # Controller, helper, views, and test directories. + m.directory File.join('app/controllers', controller_class_path) + m.directory File.join('app/helpers', controller_class_path) + m.directory File.join('app/views', controller_class_path, controller_file_name) + m.directory File.join('test/functional', controller_class_path) + + m.template 'controller.rb', + File.join('app/controllers', + controller_class_path, + "#{controller_file_name}_controller.rb") + + m.template 'functional_test.rb', + File.join('test/functional', + controller_class_path, + "#{controller_file_name}_controller_test.rb") + + m.template 'helper.rb', + File.join('app/helpers', + controller_class_path, + "#{controller_file_name}_helper.rb") + + # Controller templates + m.template "index.rhtml", + File.join('app/views', controller_class_path, controller_file_name, "index.rhtml") + end + end + + protected + # Override with your own usage banner. + def banner + "Usage: #{$0} open_id_consumer_controller [open_id]" + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/controller.rb b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/controller.rb new file mode 100644 index 00000000..50717e3d --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/controller.rb @@ -0,0 +1,74 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +class <%= controller_class_name %>Controller < ApplicationController + open_id_consumer :required => [:email, :nickname], :optional => [:fullname, :dob, :gender, :country] + + def index + @title = 'Welcome' + end + + def begin + # If the URL was unusable (either because of network conditions, + # a server error, or that the response returned was not an OpenID + # identity page), the library will return HTTP_FAILURE or PARSE_ERROR. + # Let the user know that the URL is unusable. + case open_id_response.status + when OpenID::SUCCESS + # The URL was a valid identity URL. Now we just need to send a redirect + # to the server using the redirect_url the library created for us. + + # redirect to the server + redirect_to open_id_response.redirect_url((request.protocol + request.host_with_port + '/'), url_for(:action => 'complete')) + else + flash[:error] = "Unable to find openid server for #{params[:openid_url]}" + render :action => :index + end + end + + def complete + case open_id_response.status + when OpenID::FAILURE + # In the case of failure, if info is non-nil, it is the + # URL that we were verifying. We include it in the error + # message to help the user figure out what happened. + if open_id_response.identity_url + flash[:message] = "Verification of #{open_id_response.identity_url} failed. " + else + flash[:message] = "Verification failed. " + end + flash[:message] += open_id_response.msg.to_s + + when OpenID::SUCCESS + # Success means that the transaction completed without + # error. If info is nil, it means that the user cancelled + # the verification. + flash[:message] = "You have successfully verified #{open_id_response.identity_url} as your identity." + if open_id_fields.any? + flash[:message] << "
With simple registration fields:
" + open_id_fields.each {|k,v| flash[:message] << "
#{k}: #{v}"} + end + + when OpenID::CANCEL + flash[:message] = "Verification cancelled." + + else + flash[:message] = "Unknown response status: #{open_id_response.status}" + end + redirect_to :action => 'index' + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/functional_test.rb b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/functional_test.rb new file mode 100644 index 00000000..c787b010 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/functional_test.rb @@ -0,0 +1,34 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +require File.dirname(__FILE__) + '/../test_helper' +require '<%= controller_file_name %>_controller' + +# Re-raise errors caught by the controller. +class <%= controller_class_name %>Controller; def rescue_action(e) raise e end; end + +class <%= controller_class_name %>ControllerTest < Test::Unit::TestCase + def setup + @controller = <%= controller_class_name %>Controller.new + @request = ActionController::TestRequest.new + @response = ActionController::TestResponse.new + end + + def test_truth + assert true + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/helper.rb b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/helper.rb new file mode 100644 index 00000000..1c518a5c --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/helper.rb @@ -0,0 +1,19 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +module <%= controller_class_name %>Helper +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/index.rhtml b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/index.rhtml new file mode 100644 index 00000000..4f7d22e0 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_consumer_controller/templates/index.rhtml @@ -0,0 +1,32 @@ +<% # Licensed to the Apache Software Foundation (ASF) under one + # or more contributor license agreements. See the NOTICE file + # distributed with this work for additional information + # regarding copyright ownership. The ASF licenses this file + # to you under the Apache License, Version 2.0 (the + # "License"); you may not use this file except in compliance + # with the License. You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, + # software distributed under the License is distributed on an + # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + # KIND, either express or implied. See the License for the + # specific language governing permissions and limitations + # under the License. +%> + +

<%%= @title %>

+ +
<%%= flash[:message] %>
+
<%%= flash[:error] %>
+ +

Please login with your OpenID Identity URL

+ +
+ <%%= start_form_tag :action => 'begin' %> + Identity URL: + + + +
diff --git a/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_migration/open_id_migration_generator.rb b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_migration/open_id_migration_generator.rb new file mode 100644 index 00000000..f9cd2e99 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_migration/open_id_migration_generator.rb @@ -0,0 +1,29 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +class OpenIdMigrationGenerator < Rails::Generator::NamedBase + def initialize(runtime_args, runtime_options = {}) + runtime_args << 'add_open_id_tables' if runtime_args.empty? + super + end + + def manifest + record do |m| + m.migration_template 'migration.rb', 'db/migrate' + end + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_migration/templates/migration.rb b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_migration/templates/migration.rb new file mode 100644 index 00000000..d7569bd5 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/generators/open_id_migration/templates/migration.rb @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +class <%= class_name %> < ActiveRecord::Migration + def self.up + create_table "open_id_associations", :force => true do |t| + t.column "server_url", :binary + t.column "handle", :string + t.column "secret", :binary + t.column "issued", :integer + t.column "lifetime", :integer + t.column "assoc_type", :string + end + + create_table "open_id_nonces", :force => true do |t| + t.column "nonce", :string + t.column "created", :integer + end + + create_table "open_id_settings", :force => true do |t| + t.column "setting", :string + t.column "value", :binary + end + end + + def self.down + drop_table "open_id_associations" + drop_table "open_id_nonces" + drop_table "open_id_settings" + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/init.rb b/tracks/vendor/plugins/openid_consumer_plugin/init.rb new file mode 100644 index 00000000..d3d8f53e --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/init.rb @@ -0,0 +1,23 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +class << ActionController::Base + def open_id_consumer(options = {}) + include OpenIdConsumer::ControllerMethods + self.open_id_consumer_options = options + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/install.rb b/tracks/vendor/plugins/openid_consumer_plugin/install.rb new file mode 100644 index 00000000..ba7dcb48 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/install.rb @@ -0,0 +1,18 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +puts IO.read(File.join(File.dirname(__FILE__), 'README')) diff --git a/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/active_record_open_id_store.rb b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/active_record_open_id_store.rb new file mode 100644 index 00000000..9b7bfbe0 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/active_record_open_id_store.rb @@ -0,0 +1,103 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +begin + require_gem "ruby-openid", ">= 1.0" +rescue LoadError + require "openid" +end + +module OpenIdConsumer + class ActiveRecordOpenIdStore < OpenID::Store + def get_auth_key + setting = Setting.find_by_setting 'auth_key' + if setting.nil? + auth_key = OpenID::Util.random_string(20) + setting = Setting.create :setting => 'auth_key', :value => auth_key + end + setting.value + end + + def store_association(server_url, assoc) + remove_association(server_url, assoc.handle) + Association.create(:server_url => server_url, + :handle => assoc.handle, + :secret => assoc.secret, + :issued => assoc.issued, + :lifetime => assoc.lifetime, + :assoc_type => assoc.assoc_type) + end + + def get_association(server_url, handle=nil) + assocs = handle.blank? ? + Association.find_all_by_server_url(server_url) : + Association.find_all_by_server_url_and_handle(server_url, handle) + + assocs.reverse.each do |assoc| + a = assoc.from_record + if a.expired? + assoc.destroy + else + return a + end + end if assocs.any? + + return nil + end + + def remove_association(server_url, handle) + assoc = Association.find_by_server_url_and_handle(server_url, handle) + unless assoc.nil? + assoc.destroy + return true + end + false + end + + def store_nonce(nonce) + use_nonce(nonce) + Nonce.create :nonce => nonce, :created => Time.now.to_i + end + + def use_nonce(nonce) + nonce = Nonce.find_by_nonce(nonce) + return false if nonce.nil? + + age = Time.now.to_i - nonce.created + nonce.destroy + + age < 6.hours # max nonce age of 6 hours + end + + def dumb? + false + end + + # not part of the api, but useful + def gc + now = Time.now.to_i + + # remove old nonces + nonces = Nonce.find(:all) + nonces.each {|n| n.destroy if now - n.created > 6.hours} unless nonces.nil? + + # remove expired assocs + assocs = Association.find(:all) + assocs.each { |a| a.destroy if a.from_record.expired? } unless assocs.nil? + end + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/association.rb b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/association.rb new file mode 100644 index 00000000..9d09ec47 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/association.rb @@ -0,0 +1,31 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +begin + require_gem "ruby-openid", ">= 1.0" +rescue LoadError + require "openid" +end + +module OpenIdConsumer + class Association < ActiveRecord::Base + set_table_name 'open_id_associations' + def from_record + OpenID::Association.new(handle, secret, issued, lifetime, assoc_type) + end + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/controller_methods.rb b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/controller_methods.rb new file mode 100644 index 00000000..9a61aec9 --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/controller_methods.rb @@ -0,0 +1,69 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +begin + require_gem "ruby-openid", ">= 1.0" +rescue LoadError + require "openid" +end + +module OpenIdConsumer + module ControllerMethods + def self.included(controller) + controller.class_eval do + verify :method => :post, :only => :begin, :params => :openid_url, :redirect_to => { :action => 'index' }, + :add_flash => { :error => "Enter an Identity URL to verify." } + verify :method => :get, :only => :complete, :redirect_to => { :action => 'index' } + before_filter :begin_open_id_auth, :only => :begin + before_filter :complete_open_id_auth, :only => :complete + attr_reader :open_id_response + attr_reader :open_id_fields + cattr_accessor :open_id_consumer_options + end + end + + protected + def open_id_consumer + @open_id_consumer ||= OpenID::Consumer.new( + session[:openid_session] ||= {}, + ActiveRecordOpenIdStore.new) + end + + def begin_open_id_auth + @open_id_response = open_id_consumer.begin(params[:openid_url]) + add_sreg_params!(@open_id_response) if @open_id_response.status == OpenID::SUCCESS + end + + def complete_open_id_auth + @open_id_response = open_id_consumer.complete(params) + return unless open_id_response.status == OpenID::SUCCESS + + @open_id_fields = open_id_response.extension_response('sreg') + logger.debug "***************** sreg params ***************" + logger.debug @open_id_fields.inspect + logger.debug "***************** sreg params ***************" + end + + def add_sreg_params!(openid_response) + open_id_consumer_options.keys.inject({}) do |params, key| + value = open_id_consumer_options[key] + value = value.collect { |v| v.to_s.strip } * ',' if value.respond_to?(:collect) + openid_response.add_extension_arg('sreg', key.to_s, value.to_s) + end + end + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/nonce.rb b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/nonce.rb new file mode 100644 index 00000000..67a7893d --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/nonce.rb @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +module OpenIdConsumer + class Nonce < ActiveRecord::Base + set_table_name 'open_id_nonces' + end +end diff --git a/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/setting.rb b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/setting.rb new file mode 100644 index 00000000..6616dd6e --- /dev/null +++ b/tracks/vendor/plugins/openid_consumer_plugin/lib/open_id_consumer/setting.rb @@ -0,0 +1,22 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +module OpenIdConsumer + class Setting < ActiveRecord::Base + set_table_name 'open_id_settings' + end +end diff --git a/tracks/vendor/plugins/resource_feeder/README b/tracks/vendor/plugins/resource_feeder/README deleted file mode 100644 index 5502be25..00000000 --- a/tracks/vendor/plugins/resource_feeder/README +++ /dev/null @@ -1,7 +0,0 @@ -ResourceFeeder -============== - -Simple feeds for resources - -NOTE: This plugin depends on the latest version of simply_helpful, available here: -http://dev.rubyonrails.org/svn/rails/plugins/simply_helpful/ diff --git a/tracks/vendor/plugins/resource_feeder/Rakefile b/tracks/vendor/plugins/resource_feeder/Rakefile deleted file mode 100644 index 51fce7b3..00000000 --- a/tracks/vendor/plugins/resource_feeder/Rakefile +++ /dev/null @@ -1,22 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the resource_feed plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the resource_feed plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'ResourceFeed' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/tracks/vendor/plugins/resource_feeder/init.rb b/tracks/vendor/plugins/resource_feeder/init.rb deleted file mode 100644 index 7b55d76f..00000000 --- a/tracks/vendor/plugins/resource_feeder/init.rb +++ /dev/null @@ -1,2 +0,0 @@ -require 'resource_feeder' -ActionController::Base.send(:include, ResourceFeeder::Rss, ResourceFeeder::Atom) \ No newline at end of file diff --git a/tracks/vendor/plugins/resource_feeder/lib/resource_feeder.rb b/tracks/vendor/plugins/resource_feeder/lib/resource_feeder.rb deleted file mode 100644 index b5003419..00000000 --- a/tracks/vendor/plugins/resource_feeder/lib/resource_feeder.rb +++ /dev/null @@ -1,2 +0,0 @@ -require 'resource_feeder/rss' -require 'resource_feeder/atom' diff --git a/tracks/vendor/plugins/resource_feeder/lib/resource_feeder/atom.rb b/tracks/vendor/plugins/resource_feeder/lib/resource_feeder/atom.rb deleted file mode 100644 index d3b5a63c..00000000 --- a/tracks/vendor/plugins/resource_feeder/lib/resource_feeder/atom.rb +++ /dev/null @@ -1,78 +0,0 @@ -module ResourceFeeder - module Atom - extend self - - def render_atom_feed_for(resources, options = {}) - render :text => atom_feed_for(resources, options), :content_type => Mime::ATOM - end - - def atom_feed_for(resources, options = {}) - xml = Builder::XmlMarkup.new(:indent => 2) - - options[:feed] ||= {} - options[:item] ||= {} - options[:url_writer] ||= self - - if options[:class] || resources.first - klass = options[:class] || resources.first.class - new_record = klass.new - else - options[:feed] = { :title => "Empty", :link => "http://example.com" } - end - - options[:feed][:title] ||= klass.name.pluralize - options[:feed][:id] ||= "tag:#{request.host_with_port}:#{klass.name.pluralize}" - options[:feed][:link] ||= SimplyHelpful::RecordIdentifier.polymorphic_url(new_record, options[:url_writer]) - - options[:item][:title] ||= [ :title, :subject, :headline, :name ] - options[:item][:description] ||= [ :description, :body, :content ] - options[:item][:pub_date] ||= [ :updated_at, :updated_on, :created_at, :created_on ] - options[:item][:author] ||= [ :author, :creator ] - - resource_link = lambda { |r| SimplyHelpful::RecordIdentifier.polymorphic_url(r, options[:url_writer]) } - - xml.instruct! - xml.feed "xml:lang" => "en-US", "xmlns" => 'http://www.w3.org/2005/Atom' do - xml.title(options[:feed][:title]) - xml.id(options[:feed][:id]) - xml.link(:rel => 'alternate', :type => 'text/html', :href => options[:feed][:link]) - xml.link(:rel => 'self', :type => 'application/atom+xml', :href => options[:feed][:self]) if options[:feed][:self] - xml.subtitle(options[:feed][:description]) if options[:feed][:description] - - for resource in resources - published_at = call_or_read(options[:item][:pub_date], resource) - - xml.entry do - xml.title(call_or_read(options[:item][:title], resource)) - xml.content(call_or_read(options[:item][:description], resource), :type => 'html') - xml.id("tag:#{request.host_with_port},#{published_at.xmlschema}:#{call_or_read(options[:item][:guid] || options[:item][:link] || resource_link, resource)}") - xml.published(published_at.xmlschema) - xml.updated((resource.respond_to?(:updated_at) ? call_or_read(options[:item][:pub_date] || :updated_at, resource) : published_at).xmlschema) - xml.link(:rel => 'alternate', :type => 'text/html', :href => call_or_read(options[:item][:link] || options[:item][:guid] || resource_link, resource)) - - if author = call_or_read(options[:item][:author], resource) - xml.author do - xml.name() - end - end - end - end - end - end - - private - def call_or_read(procedure_or_attributes, resource) - case procedure_or_attributes - when Array - attributes = procedure_or_attributes - resource.send(attributes.select { |a| resource.respond_to?(a) }.first) - when Symbol - attribute = procedure_or_attributes - resource.send(attribute) - when Proc - procedure = procedure_or_attributes - procedure.call(resource) - end - end - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/resource_feeder/lib/resource_feeder/rss.rb b/tracks/vendor/plugins/resource_feeder/lib/resource_feeder/rss.rb deleted file mode 100644 index b66ec4a8..00000000 --- a/tracks/vendor/plugins/resource_feeder/lib/resource_feeder/rss.rb +++ /dev/null @@ -1,79 +0,0 @@ -module ResourceFeeder - module Rss - extend self - - def render_rss_feed_for(resources, options = {}) - render :text => rss_feed_for(resources, options), :content_type => Mime::RSS - end - - def rss_feed_for(resources, options = {}) - xml = Builder::XmlMarkup.new(:indent => 2) - - options[:feed] ||= {} - options[:item] ||= {} - options[:url_writer] ||= self - - if options[:class] || resources.first - klass = options[:class] || resources.first.class - new_record = klass.new - else - options[:feed] = { :title => "Empty", :link => "http://example.com" } - end - use_content_encoded = options[:item].has_key?(:content_encoded) - - options[:feed][:title] ||= klass.name.pluralize - options[:feed][:link] ||= SimplyHelpful::RecordIdentifier.polymorphic_url(new_record, options[:url_writer]) - options[:feed][:language] ||= "en-us" - options[:feed][:ttl] ||= "40" - - options[:item][:title] ||= [ :title, :subject, :headline, :name ] - options[:item][:description] ||= [ :description, :body, :content ] - options[:item][:pub_date] ||= [ :updated_at, :updated_on, :created_at, :created_on ] - - resource_link = lambda { |r| SimplyHelpful::RecordIdentifier.polymorphic_url(r, options[:url_writer]) } - - rss_root_attributes = { :version => 2.0 } - rss_root_attributes.merge!("xmlns:content" => "http://purl.org/rss/1.0/modules/content/") if use_content_encoded - - xml.instruct! - - xml.rss(rss_root_attributes) do - xml.channel do - xml.title(options[:feed][:title]) - xml.link(options[:feed][:link]) - xml.description(options[:feed][:description]) if options[:feed][:description] - xml.language(options[:feed][:language]) - xml.ttl(options[:feed][:ttl]) - - for resource in resources - xml.item do - xml.title(call_or_read(options[:item][:title], resource)) - xml.description(call_or_read(options[:item][:description], resource)) - if use_content_encoded then - xml.content(:encoded) { xml.cdata!(call_or_read(options[:item][:content_encoded], resource)) } - end - xml.pubDate(call_or_read(options[:item][:pub_date], resource).to_s(:rfc822)) - xml.guid(call_or_read(options[:item][:guid] || options[:item][:link] || resource_link, resource)) - xml.link(call_or_read(options[:item][:link] || options[:item][:guid] || resource_link, resource)) - end - end - end - end - end - - private - def call_or_read(procedure_or_attributes, resource) - case procedure_or_attributes - when Array - attributes = procedure_or_attributes - resource.send(attributes.select { |a| resource.respond_to?(a) }.first) - when Symbol - attribute = procedure_or_attributes - resource.send(attribute) - when Proc - procedure = procedure_or_attributes - procedure.call(resource) - end - end - end -end diff --git a/tracks/vendor/plugins/resource_feeder/test/atom_feed_test.rb b/tracks/vendor/plugins/resource_feeder/test/atom_feed_test.rb deleted file mode 100644 index 3112da47..00000000 --- a/tracks/vendor/plugins/resource_feeder/test/atom_feed_test.rb +++ /dev/null @@ -1,85 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' -class AtomFeedTest < Test::Unit::TestCase - attr_reader :request - - def setup - @request = OpenStruct.new - @request.host_with_port = 'example.com' - @records = Array.new(5).fill(Post.new) - @records.each &:save - end - - def test_default_atom_feed - atom_feed_for @records - - assert_select 'feed' do - assert_select '>title', 'Posts' - assert_select '>id', "tag:#{request.host_with_port}:Posts" - assert_select '>link' do - assert_select "[rel='alternate']" - assert_select "[type='text/html']" - assert_select "[href='http://example.com/posts']" - end - assert_select 'entry', 5 do - assert_select 'title', :text => 'feed title (title)' - assert_select "content[type='html']", '<p>feed description (description)</p>' - assert_select 'id', "tag:#{request.host_with_port},#{@records.first.created_at.xmlschema}:#{'http://example.com/posts/1'}" - assert_select 'published', @records.first.created_at.xmlschema - assert_select 'updated', @records.first.created_at.xmlschema - assert_select 'link' do - assert_select "[rel='alternate']" - assert_select "[type='text/html']" - assert_select "[href='http://example.com/posts/1']" - end - end - end - end - - def test_should_allow_custom_feed_options - atom_feed_for @records, :feed => { :title => 'Custom Posts', :link => '/posts', :description => 'stuff', :self => '/posts.atom' } - - assert_select 'feed>title', 'Custom Posts' - assert_select "feed>link[href='/posts']" - assert_select 'feed>subtitle', 'stuff' - assert_select 'feed>link' do - assert_select "[rel='self']" - assert_select "[type='application/atom+xml']" - assert_select "[href='/posts.atom']" - end - end - - def test_should_allow_custom_item_attributes - atom_feed_for @records, :item => { :title => :name, :description => :body, :pub_date => :create_date, :link => :id } - - assert_select 'entry', 5 do - assert_select 'title', :text => 'feed title (name)' - assert_select "content[type='html']", '<p>feed description (body)</p>' - assert_select 'published', (@records.first.created_at - 5.minutes).xmlschema - assert_select 'updated', (@records.first.created_at - 5.minutes).xmlschema - assert_select 'id', "tag:#{request.host_with_port},#{(@records.first.created_at - 5.minutes).xmlschema}:1" - assert_select 'link' do - assert_select "[rel='alternate']" - assert_select "[type='text/html']" - assert_select "[href='1']" - end - end - end - - def test_should_allow_custom_item_attribute_blocks - atom_feed_for @records, :item => { :title => lambda { |r| r.name }, :description => lambda { |r| r.body }, :pub_date => lambda { |r| r.create_date }, - :link => lambda { |r| "/#{r.created_at.to_i}" }, :guid => lambda { |r| r.created_at.to_i } } - - assert_select 'entry', 5 do - assert_select 'title', :text => 'feed title (name)' - assert_select "content[type='html']", '<p>feed description (body)</p>' - assert_select 'published', (@records.first.created_at - 5.minutes).xmlschema - assert_select 'updated', (@records.first.created_at - 5.minutes).xmlschema - assert_select 'id', /:\d+$/ - assert_select 'link' do - assert_select "[rel='alternate']" - assert_select "[type='text/html']" - assert_select "[href=?]", /^\/\d+$/ - end - end - end -end diff --git a/tracks/vendor/plugins/resource_feeder/test/rss_feed_test.rb b/tracks/vendor/plugins/resource_feeder/test/rss_feed_test.rb deleted file mode 100644 index 90525baf..00000000 --- a/tracks/vendor/plugins/resource_feeder/test/rss_feed_test.rb +++ /dev/null @@ -1,86 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' -class RssFeedTest < Test::Unit::TestCase - def setup - @records = Array.new(5).fill(Post.new) - @records.each &:save - end - - def test_default_rss_feed - rss_feed_for @records - - assert_select 'rss[version="2.0"]' do - assert_select 'channel' do - assert_select '>title', 'Posts' - assert_select '>link', 'http://example.com/posts' - assert_select 'language', 'en-us' - assert_select 'ttl', '40' - end - assert_select 'item', 5 do - assert_select 'title', :text => 'feed title (title)' - assert_select 'description', '<p>feed description (description)</p>' - %w(guid link).each do |node| - assert_select node, 'http://example.com/posts/1' - end - assert_select 'pubDate', @records.first.created_at.to_s(:rfc822) - end - end - end - - def test_should_allow_custom_feed_options - rss_feed_for @records, :feed => { :title => 'Custom Posts', :link => '/posts', :description => 'stuff', :language => 'en-gb', :ttl => '80' } - - assert_select 'channel>title', 'Custom Posts' - assert_select 'channel>link', '/posts' - assert_select 'channel>description', 'stuff' - assert_select 'channel>language', 'en-gb' - assert_select 'channel>ttl', '80' - end - - def test_should_allow_custom_item_attributes - rss_feed_for @records, :item => { :title => :name, :description => :body, :pub_date => :create_date, :link => :id } - - assert_select 'item', 5 do - assert_select 'title', :text => 'feed title (name)' - assert_select 'description', '<p>feed description (body)</p>' - assert_select 'pubDate', (@records.first.created_at - 5.minutes).to_s(:rfc822) - assert_select 'link', '1' - assert_select 'guid', '1' - end - end - - def test_should_allow_custom_item_attribute_blocks - rss_feed_for @records, :item => { :title => lambda { |r| r.name }, :description => lambda { |r| r.body }, :pub_date => lambda { |r| r.create_date }, - :link => lambda { |r| "/#{r.created_at.to_i}" }, :guid => lambda { |r| r.created_at.to_i } } - - assert_select 'item', 5 do - assert_select 'title', :text => 'feed title (name)' - assert_select 'description', '<p>feed description (body)</p>' - assert_select 'pubDate', (@records.first.created_at - 5.minutes).to_s(:rfc822) - end - end - - # note that assert_select isnt easily able to get elements that have xml namespaces (as it thinks they are - # invalid html psuedo children), so we do some manual testing with the response body - def test_should_allow_content_encoded_for_items - rss_feed_for @records, :item => { :content_encoded => :full_html_body } - - html_content = "Here is some full content, with out any excerpts" - assert_equal 5, @response.body.scan("").size - assert_select 'item', 5 do - assert_select 'description + *', " { :content_encoded => :full_html_body } - assert_equal %[\n], - @response.body.grep(/\n], - @response.body.grep(/feed description (#{attr_name})

" - end - end - - def full_html_body - "Here is some full content, with out any excerpts" - end - - def create_date - @created_at - 5.minutes - end -end - -class Test::Unit::TestCase - include ResourceFeeder::Rss, ResourceFeeder::Atom - - def render_feed(xml) - @response = OpenStruct.new - @response.headers = {'Content-Type' => 'text/xml'} - @response.body = xml - end - - def rss_feed_for_with_ostruct(resources, options = {}) - render_feed rss_feed_for_without_ostruct(resources, options) - end - - def atom_feed_for_with_ostruct(resources, options = {}) - render_feed atom_feed_for_without_ostruct(resources, options) - end - - alias_method_chain :rss_feed_for, :ostruct - alias_method_chain :atom_feed_for, :ostruct - - def html_document - @html_document ||= HTML::Document.new(@response.body, false, true) - end - - def posts_url - "http://example.com/posts" - end - - def post_url(post) - "http://example.com/posts/#{post.id}" - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/README b/tracks/vendor/plugins/selenium-on-rails/README deleted file mode 100644 index 75a43918..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/README +++ /dev/null @@ -1,192 +0,0 @@ -= Selenium on Rails - -== Overview - -Selenium on Rails provides an easy way to test Rails application with -SeleniumCore[http://www.openqa.org/selenium-core/]. - -This plugin does four things: -1. The Selenium Core files don't have to pollute /public, they can stay in the Selenium gem or in /vendor/selenium. -2. No need to create suite files, they are generated on the fly -- one suite per directory in /test/selenium (suites can be nested). -3. Instead of writing the test cases in HTML you can use a number of better formats (see Formats). -4. Loading of fixtures and wiping of session (/selenium/setup). - -== Installation - -1. Selenium Core needs to be available. It could either be installed as a gem (gem install selenium) or in /vendor/selenium/. -2. Install Selenium on Rails: script/plugin install http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails -3. If RedCloth is available the Selenese test cases can use it for better markup. -4. Run the Rakefile in the plugin's directory to run the tests in order to see that everything works. (If RedCloth isn't installed a few tests will fail since they assume RedCloth is installed.) -5. Create a test case: script/generate selenium login -6. Start the server: script/server -e test -7. Point your browser to http://localhost:3000/selenium -8. If everything works as expected you should see the Selenium test runner. The north east frame contains all your test cases (just one for now), and the north frame contains your test case. - -=== win32-open3 - -win32-open3[http://raa.ruby-lang.org/project/win32-open3/] is needed if you're -on Windows and want to run your tests as a Rake task -(see test:acceptance), i.e. you don't have to install it but it's -recommended. - -You can build it from source or install the binary: - -1. Download the latest version of win32-open3, open3-0.2.2.so[http://rubyforge.org/frs/download.php/8515/open3-0.2.2.so] at the time of this writing. -2. Open up irb and run this snippet: require 'rbconfig'; include Config; puts CONFIG['sitearchdir'] -3. Create a win32 directory under the directory you got, e.g. c:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt -4. Rename the .so file to open3.so and put it in the win32 directory. -5. Profit! (unless you get an error when doing require 'win32/open3') - -== Formats - -The test cases can be written in a number of formats. Which one you choose is a -matter of taste. You can generate your test files by running -script/generate selenium or by creating them manually in your -/test/selenium directory. - -=== Selenese, .sel - -Selenese is the dumbest format (in a good way). You just write your commands -delimited by | characters. - - |open|/selenium/setup| - |open|/| - |goBack| - -If you don't want to write Selenese tests by hand you can use -SeleniumIDE[http://www.openqa.org/selenium-ide/] which has -support[http://wiki.openqa.org/display/SIDE/SeleniumOnRails] for Selenese. - -SeleniumIDE makes it super easy to record test and edit them. - -=== RSelenese, .rsel - -RSelenese enable you to write your tests in Ruby. - - setup :fixtures => :all - open '/' - assert_title 'Home' - ('a'..'z').each {|c| open :controller => 'user', :action => 'create', :name => c } - -See SeleniumOnRails::TestBuilder for available commands. - -=== HTML/RHTML - -You can write your tests in HTML/RHTML but that's mostly useful if you have -existing tests you want to reuse. - -=== Partial test cases - -If you have some common actions you want to do in several test cases you can put -them in a separate partial test case and include them in your other test cases. - -A partial test case is just like a normal test case besides that its filename -has to start with _: - - #_login.rsel - open '/login' - type 'name', name - type 'password', password - click 'submit', :wait=>true - -To include a partial test case you write like this in a Selenese test case: - - |includePartial|login|name=John Doe|password=eoD nhoJ| - -in a RSelenese test case: - - include_partial 'login', :name => 'Jane Doe', :password => 'Jane Doe'.reverse - -and in a RHTML test case: - - <%= render :partial => 'login', :locals => {:name = 'Joe Schmo', :password => 'Joe Schmo'.reverse} %> - -== Configuration - -There are a number of settings available. You make them by renaming -config.yml.example to config.yml and make your changes in that -file. - -=== Environments - -Per default this plugin is only available in test environment. You can change -this by setting environments, such as: - - #config.yml - environments: - - test - - development - -== test:acceptance - -You can run all your Selenium tests as a Rake task. - -First, if you're on Windows, you have to make sure win32-open3 is installed. -Then you have to configure which browsers you want to run, like this: - - #config.yml - browsers: - firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe' - ie: 'c:\Program Files\Internet Explorer\iexplore.exe' - -Now you're all set. First start a server: - - script/server -e test - -Then run the tests: - - rake test:acceptance - -Now it should work, otherwise let me know! - -=== Store results - -If you want to store the results from a test:acceptance you just need -to set in which directory they should be stored: - - #config.yml - result_dir: 'c:\result' - -So when you run rake test:acceptance the tables with the results will -be stored as .html files in that directory. - -This can be useful especially for continous integration. - -== Todo - -=== Standalone mode - -More work is needed on test:acceptance on Windows to be able to start -the server when needed. - -=== user_extension.js - -Selenium has support for user_extension.js which is a way to extend the -functionality of Selenium Core. However there is currently no easy way to add -such a file in Selenium on Rails. - -=== More setup/teardown support? - -Currently there is only support to load fixtures and to wipe the session in -/selenium/setup. Is there a need for more kinds of setups or teardowns? - -=== More documentation - - -== Not todo - -=== Editor - -Creating an editor for the test cases is currently considered out of scope for -this plugin. SeleniumIDE[http://www.openqa.org/selenium-ide/] does such a good -job and has support[http://wiki.openqa.org/display/SIDE/SeleniumOnRails] for -the Selenese format. - -== Credits - -* Jon Tirsen, http://jutopia.tirsen.com -- initial inspiration[http://wiki.rubyonrails.com/rails/pages/SeleniumIntegration] -* Eric Kidd, http://www.randomhacks.net -- contribution of RSelenese - -== Information - -For more information, check out the website[http://www.openqa.org/selenium-on-rails/]. diff --git a/tracks/vendor/plugins/selenium-on-rails/Rakefile b/tracks/vendor/plugins/selenium-on-rails/Rakefile deleted file mode 100644 index fbd733d9..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/Rakefile +++ /dev/null @@ -1,27 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rdoc/rdoc' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the Selenium on Rails plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the Selenium on Rails plugin.' -task :rdoc do - rm_rf 'doc' - RDoc::RDoc.new.document(%w(--line-numbers --inline-source --title SeleniumOnRails README lib)) -end - -begin - require 'rcov/rcovtask' - Rcov::RcovTask.new do |t| - t.test_files = FileList['test/*_test.rb'] - end -rescue LoadError #if rcov isn't available, ignore -end diff --git a/tracks/vendor/plugins/selenium-on-rails/config.yml b/tracks/vendor/plugins/selenium-on-rails/config.yml deleted file mode 100644 index 17746296..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/config.yml +++ /dev/null @@ -1,27 +0,0 @@ -# Rename this file to config.yml in order to configure the plugin - -# -# General settings -# - -environments: - - test -# - development # Uncomment this line to enable in development environment. N.B. your development database will likely be altered/destroyed/abducted - -#selenium_path: 'c:\selenium' #path to selenium installation. only needed when selenium isn't installed in /vendor/selenium or as a gem - -# -# rake test:acceptance settings -# - -browsers: - firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe' - ie: 'c:\Program Files\Internet Explorer\iexplore.exe' - -#host: 'localhost' -#port_start: 3000 -#port_end: 3005 -#max_browser_duration: 120 -#multi_window: false - -#result_dir: 'c:\result' # the directory where the results will be stored after a test:acceptance run diff --git a/tracks/vendor/plugins/selenium-on-rails/config.yml.example b/tracks/vendor/plugins/selenium-on-rails/config.yml.example deleted file mode 100644 index 17746296..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/config.yml.example +++ /dev/null @@ -1,27 +0,0 @@ -# Rename this file to config.yml in order to configure the plugin - -# -# General settings -# - -environments: - - test -# - development # Uncomment this line to enable in development environment. N.B. your development database will likely be altered/destroyed/abducted - -#selenium_path: 'c:\selenium' #path to selenium installation. only needed when selenium isn't installed in /vendor/selenium or as a gem - -# -# rake test:acceptance settings -# - -browsers: - firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe' - ie: 'c:\Program Files\Internet Explorer\iexplore.exe' - -#host: 'localhost' -#port_start: 3000 -#port_end: 3005 -#max_browser_duration: 120 -#multi_window: false - -#result_dir: 'c:\result' # the directory where the results will be stored after a test:acceptance run diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html deleted file mode 100644 index c8bcc34d..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumController.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - Class: SeleniumController - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumController
In: - - lib/controllers/selenium_controller.rb - -
-
Parent: - ActionController::Base -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- record   - setup   - support_file   - test_file   -
-
- -
- - - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/controllers/selenium_controller.rb, line 50
-50:   def record
-51:     dir = record_table
-52: 
-53:     @result = {'resultDir' => dir}
-54:     for p in ['result', 'numTestFailures', 'numTestPasses', 'numCommandFailures', 'numCommandPasses', 'numCommandErrors', 'totalTime']
-55:       @result[p] = params[p]
-56:     end
-57:     File.open(log_path(params[:logFile] || 'default.yml'), 'w') {|f| YAML.dump(@result, f)}
-58:     
-59:     render :file => view_path('record.rhtml'), :layout => layout_path
-60:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/controllers/selenium_controller.rb, line 7
- 7:   def setup
- 8:     unless params.has_key? :keep_session
- 9:       reset_session
-10:       @session_wiped = true
-11:     end
-12:     @cleared_tables = clear_tables params[:clear_tables].to_s
-13:     @loaded_fixtures = load_fixtures params[:fixtures].to_s
-14:     render :file => view_path('setup.rhtml'), :layout => layout_path
-15:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/controllers/selenium_controller.rb, line 34
-34:   def support_file
-35:     if params[:filename].empty?
-36:       redirect_to :filename => 'TestRunner.html', :test => 'tests'
-37:       return
-38:     end
-39: 
-40:     filename = File.join selenium_path, params[:filename]
-41:     if File.file? filename
-42:       type = WEBrick::HTTPUtils::DefaultMimeTypes[$1.downcase] if filename =~ /\.(\w+)$/
-43:       type ||= 'text/html'
-44:       send_file filename, :type => type, :disposition => 'inline', :stream => false
-45:     else
-46:       render :text => 'Not found', :status => 404
-47:     end
-48:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/controllers/selenium_controller.rb, line 17
-17:   def test_file
-18:     params[:testname] = '' if params[:testname].to_s == 'TestSuite.html'
-19:     filename = File.join selenium_tests_path, params[:testname]
-20:     if File.directory? filename
-21:       @suite_path = filename
-22:       render :file => view_path('test_suite.rhtml'), :layout => layout_path
-23:     elsif File.readable? filename
-24:       render_test_case filename
-25:     else
-26:       if File.directory? selenium_tests_path
-27:         render :text => 'Not found', :status => 404
-28:       else
-29:         render :text => "Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium", :status => 404
-30:       end
-31:     end
-32:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html deleted file mode 100644 index 5463a38e..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumHelper.html +++ /dev/null @@ -1,148 +0,0 @@ - - - - - - Module: SeleniumHelper - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumHelper
In: - - lib/selenium_helper.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- test_case_name   -
-
- -
- - - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_helper.rb, line 5
-5:   def test_case_name filename
-6:     File.basename(filename).sub(/\..*/,'').humanize
-7:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html deleted file mode 100644 index 34015fde..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails.html +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - Module: SeleniumOnRails - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails
In: - - lib/selenium_on_rails/paths.rb - -
- - lib/selenium_on_rails.rb - -
-
-
- - -
- - - -
- - - -
- - -
- - - - - - - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html deleted file mode 100644 index 866e8904..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/FixtureLoader.html +++ /dev/null @@ -1,231 +0,0 @@ - - - - - - Module: SeleniumOnRails::FixtureLoader - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::FixtureLoader
In: - - lib/selenium_on_rails/fixture_loader.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - -
-

Included Modules

- - -
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/fixture_loader.rb, line 6
- 6:   def available_fixtures
- 7:     fixtures = {}
- 8:     path = fixtures_path + '/'
- 9:     files = Dir["#{path}**/*.{yml,csv}"]
-10:     files.each do |file|
-11:       rel_path = file.sub(path, '')
-12:       next if skip_file? rel_path
-13:       fixture_set = File.dirname(rel_path)
-14:       fixture_set = '' if fixture_set == '.'
-15:       fixture = rel_path.sub /\.[^.]*$/, ''
-16:       fixtures[fixture_set] ||= []
-17:       fixtures[fixture_set] << fixture
-18:     end
-19:     
-20:     fixtures
-21:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/fixture_loader.rb, line 45
-45:   def clear_tables tables
-46:     table_names = tables.split /\s*,\s*/
-47:     connection = ActiveRecord::Base.connection 
-48:     table_names.each do |table|
-49:       connection.execute "DELETE FROM #{table}" 
-50:     end
-51:     table_names
-52:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/fixture_loader.rb, line 23
-23:   def load_fixtures fixtures_param
-24:     available = nil
-25:     fixtures = fixtures_param.split(/\s*,\s*/).collect do |f|
-26:       fixture_set = File.dirname f
-27:       fixture_set = '' if fixture_set == '.'
-28:       fixture = File.basename f
-29:       if fixture == 'all'
-30:         available ||= available_fixtures
-31:         available[fixture_set]
-32:       else
-33:         f
-34:       end
-35:     end
-36:     fixtures.flatten!
-37:     fixtures.reject! {|f| f.blank? }
-38: 
-39:     if fixtures.any?
-40:       Fixtures.create_fixtures fixtures_path, fixtures
-41:     end
-42:     fixtures
-43:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html deleted file mode 100644 index 77cff331..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/PartialsSupport.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - Module: SeleniumOnRails::PartialsSupport - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::PartialsSupport
In: - - lib/selenium_on_rails/partials_support.rb - -
-
-
- - -
- - - -
- -
-

-Provides partials support to test cases so they can include other partial -test cases. -

-

-The partial’s commands are returned as html table rows. -

- -
- - -
- -
-

Methods

- - -
- -
- - - -
-

Included Modules

- - -
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Extracts the commands from a partial. The partial must contain a html table -and the first row is ignored since it cannot contain a command. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/partials_support.rb, line 19
-19:   def extract_commands_from_partial partial
-20:     partial = partial.match(/.*<table>.*?<tr>.*?<\/tr>(.*?)<\/table>/im)[1]
-21:     raise "Partial '#{name}' doesn't contain any table" unless partial
-22:     partial
-23:   end
-
-
-
-
- -
- - - - -
-

-Overrides where the partial is searched for, and returns only the command -table rows. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/partials_support.rb, line 9
- 9:   def render_partial partial_path = default_template_name, object = nil, local_assigns = nil, status = nil
-10:     pattern = partial_pattern partial_path
-11:     filename = Dir[pattern].first
-12:     raise "Partial '#{partial_path}' cannot be found! (Looking for file: '#{pattern}')" unless filename
-13:     partial = render :file => filename, :use_full_path => false, :locals => local_assigns
-14:     extract_commands_from_partial partial
-15:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html deleted file mode 100644 index 1d1db9bb..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Paths.html +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - Module: SeleniumOnRails::Paths - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::Paths
In: - - lib/selenium_on_rails/paths.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 25
-25:     def fixtures_path
-26:       File.expand_path File.join(RAILS_ROOT, 'test/fixtures')
-27:     end
-
-
-
-
- -
- - - - -
-

-Returns the path to the layout template. The path is relative in relation -to the app/views/ directory since Rails doesn’t support absolute -paths to layout templates. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 19
-19:     def layout_path
-20:       rails_root = Pathname.new File.expand_path(File.join(RAILS_ROOT, 'app/views'))
-21:       view_path = Pathname.new view_path('layout')
-22:       view_path.relative_path_from(rails_root).to_s
-23:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 29
-29:     def log_path log_file
-30:       File.expand_path(File.dirname(__FILE__) + '/../../log/' + log_file)
-31:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/paths.rb, line 3
-3:     def selenium_path
-4:       @@selenium_path ||= find_selenium_path
-5:       @@selenium_path
-6:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 8
- 8:     def selenium_tests_path
- 9:       File.expand_path(File.join(RAILS_ROOT, 'test/selenium'))
-10:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 33
-33:     def skip_file? file
-34:       file.split('/').each do |f|
-35:         return true if f.upcase == 'CVS' or f.starts_with?('.') or f.ends_with?('~') or f.starts_with?('_')
-36:       end
-37:       false
-38:     end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/paths.rb, line 12
-12:     def view_path view
-13:       File.expand_path(File.dirname(__FILE__) + '/../views/' + view)
-14:     end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html deleted file mode 100644 index e8346742..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/RSelenese.html +++ /dev/null @@ -1,219 +0,0 @@ - - - - - - Class: SeleniumOnRails::RSelenese - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumOnRails::RSelenese
In: - - lib/selenium_on_rails/rselenese.rb - -
-
Parent: - - SeleniumOnRails::TestBuilder - -
-
- - -
- - - -
- -
-

-Renders Selenium test templates in a fashion analogous to rxml and -rjs templates. -

-
-  setup
-  open :controller => 'customer', :action => 'list'
-  assert_title 'Customers'
-
-

-See SeleniumOnRails::TestBuilder for a list -of available commands. -

- -
- - -
- -
-

Methods

- -
- new   - render   -
-
- -
- - - - -
- - - - - -
-

Attributes

- -
- - - - - - -
view [RW] 
-
-
- - - - -
-

Public Class methods

- -
- - - - -
-

-Create a new RSelenese renderer bound to -view. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/rselenese.rb, line 17
-17:   def initialize view
-18:     super view
-19:     @view = view
-20:   end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Render template using local_assigns. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/rselenese.rb, line 23
-23:   def render template, local_assigns
-24:     title = (@view.assigns['page_title'] or local_assigns['page_title'])
-25:     table(title) do
-26:       test = self #to enable test.command
-27: 
-28:       assign_locals_code = ''
-29:       local_assigns.each_key {|key| assign_locals_code << "#{key} = local_assigns[#{key.inspect}];"}
-30: 
-31:       eval assign_locals_code + "\n" + template
-32:     end
-33:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html deleted file mode 100644 index 593ef6bd..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Renderer.html +++ /dev/null @@ -1,156 +0,0 @@ - - - - - - Module: SeleniumOnRails::Renderer - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::Renderer
In: - - lib/selenium_on_rails/renderer.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - -
-

Included Modules

- - -
- -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/renderer.rb, line 5
- 5:   def render_test_case filename
- 6:     @template.extend SeleniumOnRails::PartialsSupport
- 7:     @page_title = test_case_name filename
- 8:     output = render_to_string :file => filename
- 9:     layout = (output =~ /<html>/i ? false : layout_path)
-10:     render :text => output, :layout => layout
-11: 
-12:     headers['Cache-control'] = 'no-cache'
-13:     headers['Pragma'] = 'no-cache'
-14:     headers['Expires'] = '-1'
-15:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html deleted file mode 100644 index 1c51f5cf..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/Selenese.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - Class: SeleniumOnRails::Selenese - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumOnRails::Selenese
In: - - lib/selenium_on_rails/selenese.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- new   - render   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/selenese.rb, line 7
-7:   def initialize view
-8:     @view = view
-9:   end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/selenese.rb, line 11
-11:   def render template, local_assigns
-12:     name = (@view.assigns['page_title'] or local_assigns['page_title'])
-13:     lines = template.strip.split "\n"
-14:     html = ''
-15:     html << extract_comments(lines)
-16:     html << extract_commands(lines, name)
-17:     html << extract_comments(lines)
-18:     raise 'You cannot have comments in the middle of commands!' if next_line lines, :any
-19:     html
-20:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html deleted file mode 100644 index 4c0dc0d6..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/SuiteRenderer.html +++ /dev/null @@ -1,223 +0,0 @@ - - - - - - Module: SeleniumOnRails::SuiteRenderer - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::SuiteRenderer
In: - - lib/selenium_on_rails/suite_renderer.rb - -
-
-
- - -
- - - -
- - - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/suite_renderer.rb, line 24
-24:   def link_to_test_case suite_name, filename
-25:     name = suite_name + test_case_name(filename)
-26:     link_to name, :action => :test_file, :testname => path_to_relative_url(filename).sub(/^\//,'')
-27:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/suite_renderer.rb, line 18
-18:   def test_cases path
-19:     tests = []
-20:     visit_all_tests path, '', nil, Proc.new {|n, p| tests << [n,p]}
-21:     tests
-22:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/suite_renderer.rb, line 2
-2:   def test_suite_name path
-3:     return 'All test cases' if [nil, '/'].include? path_to_relative_url(path)
-4:     File.split(path)[-1].humanize
-5:   end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails/suite_renderer.rb, line 7
- 7:   def test_suites path
- 8:     suites = []
- 9: 
-10:     parent_path = File.join(File.split(path).slice(0..-2)) #all but last
-11:     parent_path = path_to_relative_url parent_path
-12:     suites << ['..', parent_path] unless parent_path.nil?
-13: 
-14:     visit_all_tests path, '', Proc.new {|n, p| suites << [n,path_to_relative_url(p)]}, nil
-15:     suites
-16:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html deleted file mode 100644 index 91529e68..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilder.html +++ /dev/null @@ -1,372 +0,0 @@ - - - - - - Class: SeleniumOnRails::TestBuilder - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumOnRails::TestBuilder
In: - - lib/selenium_on_rails/test_builder.rb - -
-
Parent: - Object -
-
- - -
- - - -
- -
-

-Builds Selenium test table using a high-level Ruby interface. Normally -invoked through SeleniumOnRails::RSelenese. -

-

-See SeleniumOnRails::TestBuilderActions for -the available actions and SeleniumOnRails::TestBuilderAccessors -for the available checks. -

-

-For more information on the commands supported by TestBuilder, see the Selenium Commands -Documentation at release.openqa.org/selenium-core/nightly/reference.html. -

- -
- - -
- -
-

Methods

- -
- command   - command_and_wait   - command_verbatim   - exactize   - make_command_waiting   - new   - selenize   - table   -
-
- -
- - - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

-Create a new TestBuilder for view. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 26
-26:   def initialize view
-27:     @view = view
-28:     @output = ''
-29:     @xml = Builder::XmlMarkup.new :indent => 2, :target => @output
-30:   end
-
-
-
-
- -
- - - - -
-

-Convert str to a Selenium command name. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 15
-15:   def self.selenize str
-16:     str.camelize.gsub(/^[A-Z]/) {|s| s.downcase }
-17:   end
-
-
-
-
- -

Public Instance methods

- -
- - - - -
-

-Add a new test command using cmd, target and -value. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 41
-41:   def command cmd, target=nil, value=nil
-42:     @xml.tr do
-43:       _tdata cmd
-44:       _tdata target
-45:       _tdata value
-46:     end
-47:   end
-
-
-
-
- -
- - - - -
-

-Same as command but add AndWait to the name of -cmd. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 52
-52:   def command_and_wait cmd, target=nil, value=nil
-53:     command_verbatim cmd.to_s + 'AndWait', target, value
-54:   end
-
-
-
-
- -
- - -
- command_verbatim(cmd, target=nil, value=nil) -
- -
-

-Alias for command -

-
-
- -
- - - - -
-

-Prepends pattern with ‘exact:’ if it would be -considered containing string-match pattern otherwise. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 21
-21:   def exactize pattern
-22:     pattern.include?(':') ? "exact:#{pattern}" : pattern
-23:   end
-
-
-
-
- -
- - - - -
-

-Re routes commands in the provided block to command_and_wait instead of command. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 58
-58:   def make_command_waiting
-59:     self.class.send :alias_method, :command, :command_and_wait
-60:     yield
-61:     self.class.send :alias_method, :command, :command_verbatim 
-62:   end
-
-
-
-
- -
- - - - -
-

-Add a new table of tests, and return the HTML. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder.rb, line 33
-33:   def table title
-34:     @xml.table do
-35:       @xml.tr do @xml.th(title, :colspan => 3) end
-36:       yield self
-37:     end
-38:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html deleted file mode 100644 index a81378eb..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderAccessors.html +++ /dev/null @@ -1,1672 +0,0 @@ - - - - - - Module: SeleniumOnRails::TestBuilderAccessors - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::TestBuilderAccessors
In: - - lib/selenium_on_rails/test_builder_accessors.rb - -
-
-
- - -
- - - -
- -
-

-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. -

- -
- - -
- - - -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Gets the absolute URL of the current page. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_absolute_location(pattern) - -
  • -
  • assert_not_absolute_location(pattern) - -
  • -
  • verify_absolute_location_present(pattern) - -
  • -
  • verify_not_absolute_location(pattern) - -
  • -
  • wait_for_absolute_location(pattern) - -
  • -
  • wait_for_not_absolute_location(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 129
-129:   def store_absolute_location variable_name
-130:     command 'storeAbsoluteLocation', variable_name
-131:   end
-
-
-
-
- -
- - - - -
-

-Retrieves the message of a JavaScript alert generated during the previous -action, or fail if there were no alerts. -

-

-Getting an alert has the same effect as manually clicking OK. If an alert -is generated but you do not get/verify it, the next Selenium action will -fail. -

-

-NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert -dialog. -

-

-NOTE: Selenium does NOT support JavaScript alerts that are generated in a -page’s onload() event handler. In this case a visible dialog -WILL be generated and Selenium will hang until someone manually clicks OK. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_alert(pattern) - -
  • -
  • assert_not_alert(pattern) - -
  • -
  • verify_alert_present(pattern) - -
  • -
  • verify_not_alert(pattern) - -
  • -
  • wait_for_alert(pattern) - -
  • -
  • wait_for_not_alert(pattern) - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 66
-66:   def store_alert variable_name
-67:     command 'storeAlert', variable_name
-68:   end
-
-
-
-
- -
- - - - -
-

-Has an alert occurred? -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_alert_present - -
  • -
  • assert_alert_not_present - -
  • -
  • verify_alert_present - -
  • -
  • verify_alert_not_present - -
  • -
  • wait_for_alert_present - -
  • -
  • wait_for_alert_not_present - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 15
-15:   def store_alert_present variable_name
-16:     command 'storeAlertPresent', variable_name
-17:   end
-
-
-
-
- -
- - - - -
-

-Returns the IDs of all buttons on the page. -

-

-If a given button has no ID, it will appear as "" in this array. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_all_buttons ['but1', 'but2']
- assert_all_buttons 'but?,but?*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_all_buttons(pattern) - -
  • -
  • assert_not_all_buttons(pattern) - -
  • -
  • verify_all_buttons(pattern) - -
  • -
  • verify_not_all_buttons(pattern) - -
  • -
  • wait_for_all_buttons(pattern) - -
  • -
  • wait_for_not_all_buttons(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 400
-400:   def store_all_buttons variable_name
-401:     command 'storeAllButtons', variable_name
-402:   end
-
-
-
-
- -
- - - - -
-

-Returns the IDs of all input fields on the page. -

-

-If a given field has no ID, it will appear as "" in this array. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_all_fields ['field1', 'field2']
- assert_all_fields 'field?,field?*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_all_fields(pattern) - -
  • -
  • assert_not_all_fields(pattern) - -
  • -
  • verify_all_fields(pattern) - -
  • -
  • verify_not_all_fields(pattern) - -
  • -
  • wait_for_all_fields(pattern) - -
  • -
  • wait_for_not_all_fields(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 440
-440:   def store_all_fields variable_name
-441:     command 'storeAllFields', variable_name
-442:   end
-
-
-
-
- -
- - - - -
-

-Returns the IDs of all links on the page. -

-

-If a given link has no ID, it will appear as "" in this array. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_all_links ['link1', 'link2']
- assert_all_links 'link?,link?*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_all_links(pattern) - -
  • -
  • assert_not_all_links(pattern) - -
  • -
  • verify_all_links(pattern) - -
  • -
  • verify_not_all_links(pattern) - -
  • -
  • wait_for_all_links(pattern) - -
  • -
  • wait_for_not_all_links(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 420
-420:   def store_all_links variable_name
-421:     command 'storeAllLinks', variable_name
-422:   end
-
-
-
-
- -
- - - - -
-

-Gets the value of an element attribute. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_attribute(locator, attribute_name, pattern) - -
  • -
  • assert_not_attribute(locator, attribute_name, pattern) - -
  • -
  • verify_attribute_present(locator, attribute_name, pattern) - -
  • -
  • verify_not_attribute(locator, attribute_name, pattern) - -
  • -
  • wait_for_attribute(locator, attribute_name, pattern) - -
  • -
  • wait_for_not_attribute(locator, attribute_name, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 322
-322:   def store_attribute locator, attribute_name, variable_name
-323:     command 'storeAttribute', "#{locator}@#{attribute_name}", variable_name
-324:   end
-
-
-
-
- -
- - - - -
-

-Gets the entire text of the page. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_body_text(pattern) - -
  • -
  • assert_not_body_text(pattern) - -
  • -
  • verify_body_text_present(pattern) - -
  • -
  • verify_not_body_text(pattern) - -
  • -
  • wait_for_body_text(pattern) - -
  • -
  • wait_for_not_body_text(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 169
-169:   def store_body_text variable_name
-170:     command 'storeBodyText', variable_name
-171:   end
-
-
-
-
- -
- - - - -
-

-Gets whether a toggle-button (checkbox/radio) is checked. Fails if the -specified element doesn’t exist or isn’t a toggle-button. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_checked(locator, pattern) - -
  • -
  • assert_not_checked(locator, pattern) - -
  • -
  • verify_checked_present(locator, pattern) - -
  • -
  • verify_not_checked(locator, pattern) - -
  • -
  • wait_for_checked(locator, pattern) - -
  • -
  • wait_for_not_checked(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 239
-239:   def store_checked locator, variable_name
-240:     command 'storeChecked', locator, variable_name
-241:   end
-
-
-
-
- -
- - - - -
-

-Retrieves the message of a JavaScript confirmation dialog generated during -the previous action. -

-

-By default, the confirm function will return true, having the same -effect as manually clicking OK. This can be changed by prior execution of -the choose_cancel_on_next_confirmation command. If a confirmation -is generated but you do not get/verify it, the next Selenium action will -fail. -

-

-NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible -dialog. -

-

-NOTE: Selenium does NOT support JavaScript confirmations that are generated -in a page’s onload() event handler. In this case a visible -dialog WILL be generated and Selenium will hang until you manually click -OK. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_confirmation(pattern) - -
  • -
  • assert_not_confirmation(pattern) - -
  • -
  • verify_confirmation_present(pattern) - -
  • -
  • verify_not_confirmation(pattern) - -
  • -
  • wait_for_confirmation(pattern) - -
  • -
  • wait_for_not_confirmation(pattern) - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 92
-92:   def store_confirmation variable_name
-93:     command 'storeConfirmation', variable_name
-94:   end
-
-
-
-
- -
- - - - -
-

-Has confirm() been called? -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_confirmation_present - -
  • -
  • assert_confirmation_not_present - -
  • -
  • verify_confirmation_present - -
  • -
  • verify_confirmation_not_present - -
  • -
  • wait_for_confirmation_present - -
  • -
  • wait_for_confirmation_not_present - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 41
-41:   def store_confirmation_present variable_name
-42:     command 'storeConfirmationPresent', variable_name
-43:   end
-
-
-
-
- -
- - - - -
-

-Determines whether the specified input element is editable, i.e. -hasn’t been disabled. This method will fail if the specified element -isn’t an input element. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_editable(locator) - -
  • -
  • assert_not_editable(locator) - -
  • -
  • verify_editable(locator) - -
  • -
  • verify_not_editable(locator) - -
  • -
  • wait_for_editable(locator) - -
  • -
  • wait_for_not_editable(locator) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 380
-380:   def store_editable locator, variable_name
-381:     command 'storeEditable', locator, variable_name
-382:   end
-
-
-
-
- -
- - - - -
-

-Verifies that the specified element is somewhere on the page. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_element_present(locator) - -
  • -
  • assert_element_not_present(locator) - -
  • -
  • verify_element_present(locator) - -
  • -
  • verify_element_not_present(locator) - -
  • -
  • wait_for_element_present(locator) - -
  • -
  • wait_for_element_not_present(locator) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 349
-349:   def store_element_present locator, variable_name
-350:     command 'storeElementPresent', locator, variable_name
-351:   end
-
-
-
-
- -
- - - - -
-

-Gets the result of evaluating the specified JavaScript snippet. The snippet -may have multiple lines, but only the result of the last line will be -returned. -

-

-Note that, by default, the snippet will run in the context of the -"selenium" object itself, so this will refer to the -Selenium object, and window will refer to the top-level runner -test window, not the window of your application. -

-

-If you need a reference to the window of your application, you can refer to -this.browserbot.getCurrentWindow() and if you need to use a -locator to refer to a single element in your application page, you can use -this.page().findElement("foo") where -"foo" is your locator. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_eval(script, pattern) - -
  • -
  • assert_not_eval(script, pattern) - -
  • -
  • verify_eval_present(script, pattern) - -
  • -
  • verify_not_eval(script, pattern) - -
  • -
  • wait_for_eval(script, pattern) - -
  • -
  • wait_for_not_eval(script, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 225
-225:   def store_eval script, variable_name
-226:     command 'storeEval', script, variable_name
-227:   end
-
-
-
-
- -
- - - - -
-

-Returns the specified expression. -

-

-This is useful because of JavaScript preprocessing. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_expression(expression, pattern) - -
  • -
  • assert_not_expression(expression, pattern) - -
  • -
  • verify_expression(expression, pattern) - -
  • -
  • verify_not_expression(expression, pattern) - -
  • -
  • wait_for_expression(expression, pattern) - -
  • -
  • wait_for_not_expression(expression, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 468
-468:   def store_expression expression, variable_name
-469:     command 'storeExpression', expression, variable_name
-470:   end
-
-
-
-
- -
- - - - -
-

-Returns the entire HTML source between the opening and closing -"html" tags. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_html_source(pattern) - -
  • -
  • assert_not_html_source(pattern) - -
  • -
  • verify_html_source(pattern) - -
  • -
  • verify_not_html_source(pattern) - -
  • -
  • wait_for_html_source(pattern) - -
  • -
  • wait_for_not_html_source(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 453
-453:   def store_html_source variable_name
-454:     command 'storeHtmlSource', variable_name
-455:   end
-
-
-
-
- -
- - - - -
-

-Verify the location of the current page ends with the expected location. If -an URL querystring is provided, this is checked as well. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_location(pattern) - -
  • -
  • assert_not_location(pattern) - -
  • -
  • verify_location_present(pattern) - -
  • -
  • verify_not_location(pattern) - -
  • -
  • wait_for_location(pattern) - -
  • -
  • wait_for_not_location(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 143
-143:   def store_location expected_location, variable_name
-144:     command 'storeLocation', expected_location, variable_name
-145:   end
-
-
-
-
- -
- - - - -
-

-Retrieves the message of a JavaScript question prompt dialog generated -during the previous action. -

-

-Successful handling of the prompt requires prior execution of the -answer_on_next_prompt command. If a prompt is generated but you do -not get/verify it, the next Selenium action will fail. -

-

-NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog. -

-

-NOTE: Selenium does NOT support JavaScript prompts that are generated in a -page’s onload() event handler. In this case a visible dialog -WILL be generated and Selenium will hang until someone manually clicks OK. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_prompt(pattern) - -
  • -
  • assert_not_prompt(pattern) - -
  • -
  • verify_prompt_present(pattern) - -
  • -
  • verify_not_prompt(pattern) - -
  • -
  • wait_for_prompt(pattern) - -
  • -
  • wait_for_not_prompt(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 116
-116:   def store_prompt variable_name
-117:     command 'storePrompt', variable_name
-118:   end
-
-
-
-
- -
- - - - -
-

-Has a prompt occurred? -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_prompt_present - -
  • -
  • assert_prompt_not_present - -
  • -
  • verify_prompt_present - -
  • -
  • verify_prompt_not_present - -
  • -
  • wait_for_prompt_present - -
  • -
  • wait_for_prompt_not_present - -
  • -
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_accessors.rb, line 28
-28:   def store_prompt_present variable_name
-29:     command 'storePromptPresent', variable_name
-30:   end
-
-
-
-
- -
- - - - -
-

-Gets all option labels in the specified select drop-down. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_select_options 'fruits', ['apple', 'pear']
- assert_select_options 'fruits', 'a*,p*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_select_options(locator, pattern) - -
  • -
  • assert_not_select_options(locator, pattern) - -
  • -
  • verify_select_options_present(locator, pattern) - -
  • -
  • verify_not_select_options(locator, pattern) - -
  • -
  • wait_for_select_options(locator, pattern) - -
  • -
  • wait_for_not_select_options(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 309
-309:   def store_select_options locator, variable_name
-310:     command 'storeSelectOptions', locator, variable_name
-311:   end
-
-
-
-
- -
- - - - -
-

-Verifies that the selected option of a drop-down satisfies the -option_locator. -

-

-option_locator is typically just an option label (e.g. "John -Smith"). -

-

-See the select command for more information about option locators. -

-

-NOTE: store_selected is -currently not supported by Selenium Core. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_selected(locator, option_locator) - -
  • -
  • assert_not_selected(locator, option_locator) - -
  • -
  • verify_selected_present(locator, option_locator) - -
  • -
  • verify_not_selected(locator, option_locator) - -
  • -
  • wait_for_selected(locator, option_locator) - -
  • -
  • wait_for_not_selected(locator, option_locator) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 272
-272:   def store_selected locator, option_locator, variable_name
-273:     raise 'Not supported in Selenium Core at the moment'
-274:   end
-
-
-
-
- -
- - - - -
-

-Gets all option labels for selected options in the specified select or -multi-select element. -

-

-The pattern for the automatically generated assertions can either -take an array or a pattern. -

-
- assert_selected_options 'fruits', ['apple', 'pear']
- assert_selected_options 'fruits', 'a*,p*'
-
-

-Related Assertions, automatically generated: -

-
    -
  • assert_selected_options(locator, pattern) - -
  • -
  • assert_not_selected_options(locator, pattern) - -
  • -
  • verify_selected_options_present(locator, pattern) - -
  • -
  • verify_not_selected_options(locator, pattern) - -
  • -
  • wait_for_selected_options(locator, pattern) - -
  • -
  • wait_for_not_selected_options(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 291
-291:   def store_selected_options locator, variable_name
-292:     command 'storeSelectedOptions', locator, variable_name
-293:   end
-
-
-
-
- -
- - - - -
-

-Gets the text from a cell of a table. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_table(locator, row, column, pattern) - -
  • -
  • assert_not_table(locator, row, column, pattern) - -
  • -
  • verify_table_present(locator, row, column, pattern) - -
  • -
  • verify_not_table(locator, row, column, pattern) - -
  • -
  • wait_for_table(locator, row, column, pattern) - -
  • -
  • wait_for_not_table(locator, row, column, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 252
-252:   def store_table locator, row, column, variable_name
-253:     command 'storeTable', "#{locator}.#{row}.#{column}", variable_name
-254:   end
-
-
-
-
- -
- - - - -
-

-Gets the text of an element. This works for any element that contains text. -This command uses either the textContent (Mozilla-like browsers) -or the innerText (IE-like browsers) of the element, which is the -rendered text shown to the user. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_text(locator, pattern) - -
  • -
  • assert_not_text(locator, pattern) - -
  • -
  • verify_text_present(locator, pattern) - -
  • -
  • verify_not_text(locator, pattern) - -
  • -
  • wait_for_text(locator, pattern) - -
  • -
  • wait_for_not_text(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 200
-200:   def store_text locator, variable_name
-201:     command 'storeText', locator, variable_name
-202:   end
-
-
-
-
- -
- - - - -
-

-Verifies that the specified text pattern appears somewhere on the rendered -page shown to the user. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_text_present(pattern) - -
  • -
  • assert_text_not_present(pattern) - -
  • -
  • verify_text_present(pattern) - -
  • -
  • verify_text_not_present(pattern) - -
  • -
  • wait_for_text_present(pattern) - -
  • -
  • wait_for_text_not_present(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 336
-336:   def store_text_present pattern, variable_name
-337:     command 'storeTextPresent', pattern, variable_name
-338:   end
-
-
-
-
- -
- - - - -
-

-Gets the title of the current page. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_title(pattern) - -
  • -
  • assert_not_title(pattern) - -
  • -
  • verify_title_present(pattern) - -
  • -
  • verify_not_title(pattern) - -
  • -
  • wait_for_title(pattern) - -
  • -
  • wait_for_not_title(pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 156
-156:   def store_title variable_name
-157:     command 'storeTitle', variable_name
-158:   end
-
-
-
-
- -
- - - - -
-

-Gets the (whitespace-trimmed) value of an input field (or anything else -with a value parameter). For checkbox/radio elements, the value will be -"on" or "off" depending on whether the element is -checked or not. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_value(locator, pattern) - -
  • -
  • assert_not_value(locator, pattern) - -
  • -
  • verify_value_present(locator, pattern) - -
  • -
  • verify_not_value(locator, pattern) - -
  • -
  • wait_for_value(locator, pattern) - -
  • -
  • wait_for_not_value(locator, pattern) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 184
-184:   def store_value locator, variable_name
-185:     command 'storeValue', locator, variable_name
-186:   end
-
-
-
-
- -
- - - - -
-

-Determines if the specified element is visible. An element can be rendered -invisible by setting the CSS "visibility" property to -"hidden", or the "display" property to -"none", either for the element itself or one if its ancestors. -This method will fail if the element is not present. -

-

-Related Assertions, automatically generated: -

-
    -
  • assert_visible(locator) - -
  • -
  • assert_not_visible(locator) - -
  • -
  • verify_visible(locator) - -
  • -
  • verify_not_visible(locator) - -
  • -
  • wait_for_visible(locator) - -
  • -
  • wait_for_not_visible(locator) - -
  • -
-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_accessors.rb, line 365
-365:   def store_visible locator, variable_name
-366:     command 'storeVisible', locator, variable_name
-367:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html deleted file mode 100644 index f9d605f0..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRails/TestBuilderActions.html +++ /dev/null @@ -1,1050 +0,0 @@ - - - - - - Module: SeleniumOnRails::TestBuilderActions - - - - - - - - - - -
- - - - - - - - - - -
ModuleSeleniumOnRails::TestBuilderActions
In: - - lib/selenium_on_rails/test_builder_actions.rb - -
-
-
- - -
- - - -
- -
-

-The actions available for SeleniumOnRails::TestBuilder tests. -

-

-For each action foo there’s also an action -foo_and_wait. -

- -
- - -
- -
-

Methods

- - -
- -
- - - - -
- - - - - - - - - -
-

Public Instance methods

- -
- - - - -
-

-Add a selection to the set of selected options in a multi-select element -using an option locator. -

-

-See the select -command for more information about option locators. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 142
-142:   def add_selection locator, option_locator
-143:     command 'addSelection', locator, option_locator
-144:   end
-
-
-
-
- -
- - - - -
-

-Instructs Selenium to return the specified answer string in response to the -next JavaScript prompt (window.prompt()). -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 193
-193:   def answer_on_next_prompt answer
-194:     command 'answerOnNextPrompt', answer
-195:   end
-
-
-
-
- -
- - - - -
-

-Check a toggle-button (checkbox/radio). -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 102
-102:   def check locator
-103:     command 'check', locator
-104:   end
-
-
-
-
- -
- - - - -
-

-By default, Selenium’s overridden window.confirm() function -will return true, as if the user had manually clicked OK. After -running this command, the next call to confirm() will return -false, as if the user had clicked Cancel. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 187
-187:   def choose_cancel_on_next_confirmation
-188:     command 'chooseCancelOnNextConfirmation'
-189:   end
-
-
-
-
- -
- - - - -
-

-Clicks on a link, button, checkbox or radio button. If the click action -causes a new page to load (like a link usually does), call wait_for_page_to_load. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 47
-47:   def click locator
-48:     command 'click', locator
-49:   end
-
-
-
-
- -
- - - - -
-

-Simulates the user clicking the "close" button in the titlebar of -a popup window or tab. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 209
-209:   def close
-210:     command 'close'
-211:   end
-
-
-
-
- -
- - - - -
-

-Explicitly simulate an event (e.g. "focus", -"blur"), to trigger the corresponding -"on_event_" handler. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 53
-53:   def fire_event locator, event_name
-54:     command 'fireEvent', locator, event_name
-55:   end
-
-
-
-
- -
- - - - -
-

-Simulates the user clicking the "back" button on their browser. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 198
-198:   def go_back
-199:     command 'goBack'
-200:   end
-
-
-
-
- -
- - - - -
-

-Includes a partial. The path is relative to the Selenium tests root. The -starting _ and the file extension don’t have to be specified. -

-
-  #include test/selenium/_partial.*
-  include_partial 'partial'
-  #include test/selenium/suite/_partial.*
-  include_partial 'suite/partial'
-  #include test/selenium/suite/_partial.* and provide local assigns
-  include_partial 'suite/partial', :foo => bar
-
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 39
-39:   def include_partial path, local_assigns = {}
-40:     partial = @view.render :partial => path, :locals => local_assigns
-41:     @output << partial
-42:   end
-
-
-
-
- -
- - - - -
-

-Simulates a user pressing a key (without releasing it yet). -

-

-keycode is the numeric keycode of the key to be pressed, normally -the ASCII value of that key. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 69
-69:   def key_down locator, keycode
-70:     command 'keyDown', locator, keycode
-71:   end
-
-
-
-
- -
- - - - -
-

-Simulates a user pressing and releasing a key. -

-

-keycode is the numeric keycode of the key to be pressed, normally -the ASCII value of that key. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 61
-61:   def key_press locator, keycode
-62:     command 'keyPress', locator, keycode
-63:   end
-
-
-
-
- -
- - - - -
-

-Simulates a user releasing a key. -

-

-keycode is the numeric keycode of the key to be released, normally -the ASCII value of that key. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 77
-77:   def key_up locator, keycode
-78:     command 'keyUp', locator, keycode
-79:   end
-
-
-
-
- -
- - - - -
-

-Simulates a user pressing the mouse button (without releasing it yet) on -the specified element. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 88
-88:   def mouse_down locator
-89:     command 'mouseDown', locator
-90:   end
-
-
-
-
- -
- - - - -
-

-Simulates a user hovering a mouse over the specified element. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 82
-82:   def mouse_over locator
-83:     command 'mouseOver', locator
-84:   end
-
-
-
-
- -
- - - - -
-

-Opens an URL in the test frame. This accepts both relative and absolute -URLs. The open command waits for the page to load before -proceeding, i.e. you don’t have to call wait_for_page_to_load. -

-

-Note: The URL must be on the same domain as the runner HTML due to security -restrictions in the browser (Same Origin Policy). -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 166
-166:   def open url
-167:     command 'open', url_arg(url)
-168:   end
-
-
-
-
- -
- - - - -
-

-Simulates the user clicking the "Refresh" button on their -browser. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 203
-203:   def refresh
-204:     command 'refresh'
-205:   end
-
-
-
-
- -
- - - - -
-

-Remove a selection from the set of selected options in a multi-select -element using an option locator. -

-

-See the select command for more information about option locators. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 150
-150:   def remove_selection locator, option_locator
-151:     command 'removeSelection', locator, option_locator
-152:   end
-
-
-
-
- -
- - - - -
-

-Select an option from a drop-down using an option locator. -

-

-Option locators provide different ways of specifying options of an HTML -Select element (e.g. for selecting a specific option, or for asserting that -the selected option satisfies a specification). There are several forms of -Select Option Locator. -

-
    -
  • label=labelPattern matches options based on their labels, i.e. the visible -text. (This is the default.) - -
    -  label=regexp:^[Oo]ther
    -
    -
  • -
  • value=valuePattern matches options based on their values. - -
    -  value=other
    -
    -
  • -
  • id=id matches options based on their ids. - -
    -  id=option1
    -
    -
  • -
  • index=index matches an option based on its index (offset from zero). - -
    -  index=2
    -
    -
  • -
-

-If no option locator prefix is provided, the default behaviour is to match -on label. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 134
-134:   def select locator, option_locator
-135:     command 'select', locator, option_locator
-136:   end
-
-
-
-
- -
- - - - -
-

-Selects a popup window; once a popup window has been selected, all commands -go to that window. To select the main window again, use nil as the -target. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 172
-172:   def select_window window_id
-173:     command 'selectWindow', window_id||'null'
-174:   end
-
-
-
-
- -
- - - - -
-

-Writes a message to the status bar and adds a note to the browser-side log. -

-

-context is the message sent to the browser. -

-

-log_level_threshold can be nil, :debug, -:info, :warn or :error. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 219
-219:   def set_context context, log_level_threshold = nil
-220:     if log_level_threshold
-221:       command 'setContext', context, log_level_threshold.to_s
-222:     else
-223:       command 'setContext', context
-224:     end
-225:   end
-
-
-
-
- -
- - - - -
-

-Specifies the amount of time that Selenium will wait for actions to -complete. -

-

-Actions that require waiting include open and the -wait_for* actions. -

-

-The default timeout is 30 seconds. -

-

-timeout is specified in milliseconds. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 251
-251:   def set_timeout timeout
-252:     command 'setTimeout', timeout
-253:   end
-
-
-
-
- -
- - - - -
-

-Tell Selenium on Rails to clear the session and load any fixtures. DO NOT -CALL THIS AGAINST NON-TEST DATABASES. The supported options are -:keep_session, :fixtures and :clear_tables -

-
-  setup
-  setup :keep_session
-  setup :fixtures => :all
-  setup :keep_session, :fixtures => [:foo, :bar]
-  setup :clear_tables => [:foo, :bar]
-
-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 14
-14:   def setup options = {}
-15:     options = {options => nil} unless options.is_a? Hash
-16: 
-17:     opts = {:controller => 'selenium', :action => 'setup'}
-18:     opts[:keep_session] = true if options.has_key? :keep_session
-19: 
-20:     [:fixtures, :clear_tables].each do |key|
-21:       if (f = options[key])
-22:         f = [f] unless f.is_a? Array
-23:         opts[key] = f.join ','
-24:       end
-25:     end
-26: 
-27:     open opts
-28:   end
-
-
-
-
- -
- - - - -
-

-Submit the specified form. This is particularly useful for forms without -submit buttons, e.g. single-input "Search" forms. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 156
-156:   def submit locator
-157:     command 'submit', locator
-158:   end
-
-
-
-
- -
- - - - -
-

-Sets the value of an input field, as though you typed it in. -

-

-Can also be used to set the value of combo boxes, check boxes, etc. In -these cases, value should be the value of the option selected, not -the visible text. -

-

[Source]

-
-
-    # File lib/selenium_on_rails/test_builder_actions.rb, line 97
-97:   def type locator, value
-98:     command 'type', locator, value
-99:   end
-
-
-
-
- -
- - - - -
-

-Uncheck a toggle-button (checkbox/radio). -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 107
-107:   def uncheck locator
-108:     command 'uncheck', locator
-109:   end
-
-
-
-
- -
- - - - -
-

-Runs the specified JavaScript snippet repeatedly until it evaluates to -true. The snippet may have multiple lines, but only the result of -the last line will be considered. -

-

-Note that, by default, the snippet will be run in the runner’s test -window, not in the window of your application. To get the window of your -application, you can use the JavaScript snippet -selenium.browserbot.getCurrentWindow(), and then run your -JavaScript in there. -

-

-timeout is specified in milliseconds. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 238
-238:   def wait_for_condition script, timeout
-239:     command 'waitForCondition', script, timeout
-240:   end
-
-
-
-
- -
- - - - -
-

-Waits for a new page to load. -

-

-You can use this command instead of the and_wait suffixes, -click_and_wait, select_and_wait, type_and_wait -etc. (which are only available in the JS API). -

-

-Selenium constantly keeps track of new pages loading, and sets a -newPageLoaded flag when it first notices a page load. Running any -other Selenium command after turns the flag to false. Hence, if -you want to wait for a page to load, you must wait immediately after a -Selenium command that caused a page-load. -

-

-timeout is specified in milliseconds. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 268
-268:   def wait_for_page_to_load timeout
-269:     command 'waitForPageToLoad', timeout
-270:   end
-
-
-
-
- -
- - - - -
-

-Waits for a popup window to appear and load up. -

-

-The timeout is specified in milliseconds. -

-

[Source]

-
-
-     # File lib/selenium_on_rails/test_builder_actions.rb, line 179
-179:   def wait_for_popup window_id, timeout
-180:     command 'waitForPopUp', window_id||'null', timeout
-181:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html b/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html deleted file mode 100644 index 960d3b15..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/classes/SeleniumOnRailsConfig.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Class: SeleniumOnRailsConfig - - - - - - - - - - -
- - - - - - - - - - - - - - -
ClassSeleniumOnRailsConfig
In: - - lib/selenium_on_rails_config.rb - -
-
Parent: - Object -
-
- - -
- - - -
- - - -
- -
-

Methods

- -
- get   -
-
- -
- - - - -
- - - - - - - - - -
-

Public Class methods

- -
- - - - -
-

[Source]

-
-
-    # File lib/selenium_on_rails_config.rb, line 5
- 5:   def self.get var, default = nil
- 6:     value = configs[var.to_s]
- 7:     value ||= @@defaults[var]
- 8:     value ||= default
- 9:     value ||= yield if block_given?
-10:     value
-11:   end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/README.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/README.html deleted file mode 100644 index 77e99926..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/README.html +++ /dev/null @@ -1,388 +0,0 @@ - - - - - - File: README - - - - - - - - - - -
-

README

- - - - - - - - - -
Path:README -
Last Update:Fri Dec 08 00:50:30 GMT Standard Time 2006
-
- - -
- - - -
- -
-

Selenium on Rails

-

Overview

-

-Selenium on Rails provides an easy way to test Rails application with Selenium Core. -

-

-This plugin does four things: -

-
    -
  1. The Selenium Core files don’t have to pollute /public, they -can stay in the Selenium gem or in /vendor/selenium. - -
  2. -
  3. No need to create suite files, they are generated on the fly — one -suite per directory in /test/selenium (suites can be nested). - -
  4. -
  5. Instead of writing the test cases in HTML you can use a number of better -formats (see Formats). - -
  6. -
  7. Loading of fixtures and wiping of session (/selenium/setup). - -
  8. -
-

Installation

-
    -
  1. Selenium Core needs to be available. It could either be installed as a gem -(gem install selenium) or in /vendor/selenium/. - -
  2. -
  3. Install Selenium on Rails: script/plugin install http://svn.openqa.org/svn/selenium-on-rails/selenium-on-rails/ - -
  4. -
  5. If RedCloth is available the Selenese test cases can use it for better -markup. - -
  6. -
  7. Run the Rakefile in the plugin’s directory to run the tests in order -to see that everything works. (If RedCloth isn’t installed a few -tests will fail since they assume RedCloth is installed.) - -
  8. -
  9. Create a test case: script/generate selenium login - -
  10. -
  11. Start the server: script/server -e test - -
  12. -
  13. Point your browser to http://localhost:3000/selenium - -
  14. -
  15. If everything works as expected you should see the Selenium test runner. -The north east frame contains all your test cases (just one for now), and -the north frame contains your test case. - -
  16. -
-

win32-open3

-

-win32-open3 is -needed if you’re on Windows and want to run your tests as a Rake task -(see test:acceptance), i.e. you don’t have to install it but -it’s recommended. -

-

-You can build it from source or install the binary: -

-
    -
  1. Download the latest version of win32-open3, open3-0.2.2.so -at the time of this writing. - -
  2. -
  3. Open up irb and run this snippet: require ‘rbconfig’; -include Config; puts CONFIG[‘sitearchdir’] - -
  4. -
  5. Create a win32 directory under the directory you got, e.g. -c:\ruby\lib\ruby\site_ruby\1.8\i386-msvcrt - -
  6. -
  7. Rename the .so file to open3.so and put it in the win32 -directory. - -
  8. -
  9. Profit! (unless you get an error when doing require -‘win32/open3‘) - -
  10. -
-

Formats

-

-The test cases can be written in a number of formats. Which one you choose -is a matter of taste. You can generate your test files by running -script/generate selenium or by creating them manually in your -/test/selenium directory. -

-

Selenese, .sel

-

-Selenese is the dumbest format (in a good way). You just write your -commands delimited by | characters. -

-
- |open|/selenium/setup|
- |open|/|
- |goBack|
-
-

-If you don’t want to write Selenese tests by hand you can use SeleniumIDE which has support for -Selenese. -

-

-SeleniumIDE makes it super easy to record test and edit them. -

-

RSelenese, .rsel

-

-RSelenese enable you to write your tests in Ruby. -

-
- setup :fixtures => :all
- open '/'
- assert_title 'Home'
- ('a'..'z').each {|c| open :controller => 'user', :action => 'create', :name => c }
-
-

-See SeleniumOnRails::TestBuilder -for available commands. -

-

HTML/RHTML

-

-You can write your tests in HTML/RHTML but that’s mostly useful if -you have existing tests you want to reuse. -

-

Partial test cases

-

-If you have some common actions you want to do in several test cases you -can put them in a separate partial test case and include them in your other -test cases. -

-

-A partial test case is just like a normal test case besides that its -filename has to start with _: -

-
- #_login.rsel
- open '/login'
- type 'name', name
- type 'password', password
- click 'submit', :wait=>true
-
-

-To include a partial test case you write like this in a Selenese test case: -

-
- |includePartial|login|name=John Doe|password=eoD nhoJ|
-
-

-in a RSelenese test case: -

-
- include_partial 'login', :name => 'Jane Doe', :password => 'Jane Doe'.reverse
-
-

-and in a RHTML test case: -

-
- <%= render :partial => 'login', :locals => {:name = 'Joe Schmo', :password => 'Joe Schmo'.reverse} %>
-
-

Configuration

-

-There are a number of settings available. You make them by renaming -config.yml.example to config.yml and make your changes in -that file. -

-

Environments

-

-Per default this plugin is only available in test environment. You can -change this by setting environments, such as: -

-
- #config.yml
- environments:
-   - test
-   - development
-
-

test:acceptance

-

-You can run all your Selenium tests as a Rake task. -

-

-First, if you’re on Windows, you have to make sure win32-open3 is -installed. Then you have to configure which browsers you want to run, like -this: -

-
- #config.yml
- browsers:
-   firefox: 'c:\Program Files\Mozilla Firefox\firefox.exe'
-   ie: 'c:\Program Files\Internet Explorer\iexplore.exe'
-
-

-Now you’re all set. First start a server: -

-
- script/server -e test
-
-

-Then run the tests: -

-
- rake test:acceptance
-
-

-Now it should work, otherwise let me know! -

-

Store results

-

-If you want to store the results from a test:acceptance you just -need to set in which directory they should be stored: -

-
- #config.yml
- result_dir: 'c:\result'
-
-

-So when you run rake test:acceptance the tables with the results -will be stored as .html files in that directory. -

-

-This can be useful especially for continous integration. -

-

Todo

-

Standalone mode

-

-More work is needed on test:acceptance on Windows to be able to -start the server when needed. -

-

user_extension.js

-

-Selenium has support for user_extension.js which is a way to -extend the functionality of Selenium Core. However there is currently no -easy way to add such a file in Selenium on Rails. -

-

More setup/teardown support?

-

-Currently there is only support to load fixtures and to wipe the session in -/selenium/setup. Is there a need for more kinds of setups or -teardowns? -

-

More documentation

-

Not todo

-

Editor

-

-Creating an editor for the test cases is currently considered out of scope -for this plugin. SeleniumIDE does such a good -job and has support for -the Selenese format. -

-

Credits

- -

Information

-

-For more information, check out the website. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html deleted file mode 100644 index 6e2ec72f..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/controllers/selenium_controller_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: selenium_controller.rb - - - - - - - - - - -
-

selenium_controller.rb

- - - - - - - - - -
Path:lib/controllers/selenium_controller.rb -
Last Update:Fri Dec 08 00:52:51 GMT Standard Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- webrick/httputils   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html deleted file mode 100644 index ff03a2c4..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_helper_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: selenium_helper.rb - - - - - - - - - - -
-

selenium_helper.rb

- - - - - - - - - -
Path:lib/selenium_helper.rb -
Last Update:Sun Feb 05 01:02:10 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html deleted file mode 100644 index 50258cfe..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/acceptance_test_runner_rb.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - File: acceptance_test_runner.rb - - - - - - - - - - -
-

acceptance_test_runner.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/acceptance_test_runner.rb -
Last Update:Fri Dec 08 00:16:44 GMT Standard Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- net/http   - tempfile   -
-
- -
- -
-

Methods

- -
- c   - c_b   -
-
- -
- - - - -
- - -
-

Constants

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BROWSERS=c :browsers, {}
REUSE_EXISTING_SERVER=c :reuse_existing_server, true
START_SERVER=c :start_server, false
PORTS=c(:port_start, 3000)..c(:port_end, 3005)
TEST_RUNNER_URL=c :test_runner_url, '/selenium/TestRunner.html'
MAX_BROWSER_DURATION=c :max_browser_duration, 2*60
SERVER_COMMAND=c_b :server_command do server_path = File.expand_path(File.dirname(__FILE__) + '/../../../../../script/server')
-
-
- - - - - - - -
-

Public Instance methods

- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/acceptance_test_runner.rb, line 7
-7: def c(var, default = nil) SeleniumOnRailsConfig.get var, default end
-
-
-
-
- -
- - - - -
-

[Source]

-
-
-   # File lib/selenium_on_rails/acceptance_test_runner.rb, line 8
-8: def c_b(var, default = nil) SeleniumOnRailsConfig.get(var, default) { yield } end
-
-
-
-
- - -
- - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html deleted file mode 100644 index 5ef627b1..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/fixture_loader_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: fixture_loader.rb - - - - - - - - - - -
-

fixture_loader.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/fixture_loader.rb -
Last Update:Sun Feb 05 00:59:28 W. Europe Standard Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- active_record/fixtures   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html deleted file mode 100644 index 93c43ec6..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/partials_support_rb.html +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - File: partials_support.rb - - - - - - - - - - -
-

partials_support.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/partials_support.rb -
Last Update:Tue May 02 00:43:37 W. Europe Daylight Time 2006
-
- - -
- - - -
- -
-

-Provides partials support to test cases so they can include other partial -test cases. -

-

-The partial’s commands are returned as html table rows. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html deleted file mode 100644 index d1a48f63..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/paths_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: paths.rb - - - - - - - - - - -
-

paths.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/paths.rb -
Last Update:Sun Feb 05 00:59:28 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html deleted file mode 100644 index cc9595fc..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/renderer_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: renderer.rb - - - - - - - - - - -
-

renderer.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/renderer.rb -
Last Update:Sun Feb 05 00:59:29 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html deleted file mode 100644 index 3e73734e..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/rselenese_rb.html +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - File: rselenese.rb - - - - - - - - - - -
-

rselenese.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/rselenese.rb -
Last Update:Sun Feb 19 12:59:40 W. Europe Standard Time 2006
-
- - -
- - - -
- -
-

-Renders Selenium test templates in a fashion analogous to rxml and -rjs templates. -

-
-  setup
-  open :controller => 'customer', :action => 'list'
-  assert_title 'Customers'
-
-

-See SeleniumOnRails::TestBuilder -for a list of available commands. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html deleted file mode 100644 index 2e40de16..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/selenese_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: selenese.rb - - - - - - - - - - -
-

selenese.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/selenese.rb -
Last Update:Sun Feb 05 00:56:55 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html deleted file mode 100644 index 25a9037d..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/suite_renderer_rb.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - File: suite_renderer.rb - - - - - - - - - - -
-

suite_renderer.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/suite_renderer.rb -
Last Update:Sun Feb 05 04:12:56 W. Europe Standard Time 2006
-
- - -
- - - -
- - - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html deleted file mode 100644 index 8aca17f2..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_accessors_rb.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - - - File: test_builder_accessors.rb - - - - - - - - - - -
-

test_builder_accessors.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/test_builder_accessors.rb -
Last Update:Tue Jun 06 03:01:29 W. Europe Daylight Time 2006
-
- - -
- - - -
- -
-

-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. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html deleted file mode 100644 index 343a10e5..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_actions_rb.html +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - File: test_builder_actions.rb - - - - - - - - - - -
-

test_builder_actions.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/test_builder_actions.rb -
Last Update:Tue Jun 06 03:12:04 W. Europe Daylight Time 2006
-
- - -
- - - -
- -
-

-The actions available for SeleniumOnRails::TestBuilder -tests. -

-

-For each action foo there’s also an action -foo_and_wait. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html deleted file mode 100644 index 9bdc7e5a..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails/test_builder_rb.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - File: test_builder.rb - - - - - - - - - - -
-

test_builder.rb

- - - - - - - - - -
Path:lib/selenium_on_rails/test_builder.rb -
Last Update:Tue Jun 06 02:47:24 W. Europe Daylight Time 2006
-
- - -
- - - -
- -
-

-Builds Selenium test table using a high-level Ruby interface. Normally -invoked through SeleniumOnRails::RSelenese. -

-

-See SeleniumOnRails::TestBuilderActions -for the available actions and SeleniumOnRails::TestBuilderAccessors -for the available checks. -

-

-For more information on the commands supported by TestBuilder, see the -Selenium Commands Documentation at release.openqa.org/selenium-core/nightly/reference.html. -

- -
- - -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html deleted file mode 100644 index 26a16055..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_config_rb.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - File: selenium_on_rails_config.rb - - - - - - - - - - -
-

selenium_on_rails_config.rb

- - - - - - - - - -
Path:lib/selenium_on_rails_config.rb -
Last Update:Mon Feb 20 21:58:17 W. Europe Standard Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- yaml   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html b/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html deleted file mode 100644 index aad82ae8..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/files/lib/selenium_on_rails_rb.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - - File: selenium_on_rails.rb - - - - - - - - - - -
-

selenium_on_rails.rb

- - - - - - - - - -
Path:lib/selenium_on_rails.rb -
Last Update:Thu May 04 01:18:20 W. Europe Daylight Time 2006
-
- - -
- - - -
- - -
-

Required files

- -
- selenium_on_rails/selenese   - selenium_on_rails/test_builder   - selenium_on_rails/rselenese   - selenium_on_rails/suite_renderer   - selenium_on_rails/paths   - selenium_on_rails/fixture_loader   - selenium_on_rails/partials_support   - selenium_on_rails/renderer   -
-
- -
- - -
- - - - -
- - - - - - - - - - - -
- - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/fr_class_index.html b/tracks/vendor/plugins/selenium-on-rails/doc/fr_class_index.html deleted file mode 100644 index 9e823f53..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/fr_class_index.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - Classes - - - - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/fr_file_index.html b/tracks/vendor/plugins/selenium-on-rails/doc/fr_file_index.html deleted file mode 100644 index 765c4f3c..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/fr_file_index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - Files - - - - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/fr_method_index.html b/tracks/vendor/plugins/selenium-on-rails/doc/fr_method_index.html deleted file mode 100644 index 1a25e630..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/fr_method_index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - - Methods - - - - - -
-

Methods

-
- add_selection (SeleniumOnRails::TestBuilderActions)
- answer_on_next_prompt (SeleniumOnRails::TestBuilderActions)
- available_fixtures (SeleniumOnRails::FixtureLoader)
- c (lib/selenium_on_rails/acceptance_test_runner.rb)
- c_b (lib/selenium_on_rails/acceptance_test_runner.rb)
- check (SeleniumOnRails::TestBuilderActions)
- choose_cancel_on_next_confirmation (SeleniumOnRails::TestBuilderActions)
- clear_tables (SeleniumOnRails::FixtureLoader)
- click (SeleniumOnRails::TestBuilderActions)
- close (SeleniumOnRails::TestBuilderActions)
- command (SeleniumOnRails::TestBuilder)
- command_and_wait (SeleniumOnRails::TestBuilder)
- command_verbatim (SeleniumOnRails::TestBuilder)
- exactize (SeleniumOnRails::TestBuilder)
- extract_commands_from_partial (SeleniumOnRails::PartialsSupport)
- fire_event (SeleniumOnRails::TestBuilderActions)
- fixtures_path (SeleniumOnRails::Paths)
- get (SeleniumOnRailsConfig)
- go_back (SeleniumOnRails::TestBuilderActions)
- include_partial (SeleniumOnRails::TestBuilderActions)
- key_down (SeleniumOnRails::TestBuilderActions)
- key_press (SeleniumOnRails::TestBuilderActions)
- key_up (SeleniumOnRails::TestBuilderActions)
- layout_path (SeleniumOnRails::Paths)
- link_to_test_case (SeleniumOnRails::SuiteRenderer)
- load_fixtures (SeleniumOnRails::FixtureLoader)
- log_path (SeleniumOnRails::Paths)
- make_command_waiting (SeleniumOnRails::TestBuilder)
- mouse_down (SeleniumOnRails::TestBuilderActions)
- mouse_over (SeleniumOnRails::TestBuilderActions)
- new (SeleniumOnRails::Selenese)
- new (SeleniumOnRails::TestBuilder)
- new (SeleniumOnRails::RSelenese)
- open (SeleniumOnRails::TestBuilderActions)
- record (SeleniumController)
- refresh (SeleniumOnRails::TestBuilderActions)
- remove_selection (SeleniumOnRails::TestBuilderActions)
- render (SeleniumOnRails::Selenese)
- render (SeleniumOnRails::RSelenese)
- render_partial (SeleniumOnRails::PartialsSupport)
- render_test_case (SeleniumOnRails::Renderer)
- select (SeleniumOnRails::TestBuilderActions)
- select_window (SeleniumOnRails::TestBuilderActions)
- selenium_path (SeleniumOnRails::Paths)
- selenium_tests_path (SeleniumOnRails::Paths)
- selenize (SeleniumOnRails::TestBuilder)
- set_context (SeleniumOnRails::TestBuilderActions)
- set_timeout (SeleniumOnRails::TestBuilderActions)
- setup (SeleniumController)
- setup (SeleniumOnRails::TestBuilderActions)
- skip_file? (SeleniumOnRails::Paths)
- store_absolute_location (SeleniumOnRails::TestBuilderAccessors)
- store_alert (SeleniumOnRails::TestBuilderAccessors)
- store_alert_present (SeleniumOnRails::TestBuilderAccessors)
- store_all_buttons (SeleniumOnRails::TestBuilderAccessors)
- store_all_fields (SeleniumOnRails::TestBuilderAccessors)
- store_all_links (SeleniumOnRails::TestBuilderAccessors)
- store_attribute (SeleniumOnRails::TestBuilderAccessors)
- store_body_text (SeleniumOnRails::TestBuilderAccessors)
- store_checked (SeleniumOnRails::TestBuilderAccessors)
- store_confirmation (SeleniumOnRails::TestBuilderAccessors)
- store_confirmation_present (SeleniumOnRails::TestBuilderAccessors)
- store_editable (SeleniumOnRails::TestBuilderAccessors)
- store_element_present (SeleniumOnRails::TestBuilderAccessors)
- store_eval (SeleniumOnRails::TestBuilderAccessors)
- store_expression (SeleniumOnRails::TestBuilderAccessors)
- store_html_source (SeleniumOnRails::TestBuilderAccessors)
- store_location (SeleniumOnRails::TestBuilderAccessors)
- store_prompt (SeleniumOnRails::TestBuilderAccessors)
- store_prompt_present (SeleniumOnRails::TestBuilderAccessors)
- store_select_options (SeleniumOnRails::TestBuilderAccessors)
- store_selected (SeleniumOnRails::TestBuilderAccessors)
- store_selected_options (SeleniumOnRails::TestBuilderAccessors)
- store_table (SeleniumOnRails::TestBuilderAccessors)
- store_text (SeleniumOnRails::TestBuilderAccessors)
- store_text_present (SeleniumOnRails::TestBuilderAccessors)
- store_title (SeleniumOnRails::TestBuilderAccessors)
- store_value (SeleniumOnRails::TestBuilderAccessors)
- store_visible (SeleniumOnRails::TestBuilderAccessors)
- submit (SeleniumOnRails::TestBuilderActions)
- support_file (SeleniumController)
- table (SeleniumOnRails::TestBuilder)
- test_case_name (SeleniumHelper)
- test_cases (SeleniumOnRails::SuiteRenderer)
- test_file (SeleniumController)
- test_suite_name (SeleniumOnRails::SuiteRenderer)
- test_suites (SeleniumOnRails::SuiteRenderer)
- type (SeleniumOnRails::TestBuilderActions)
- uncheck (SeleniumOnRails::TestBuilderActions)
- view_path (SeleniumOnRails::Paths)
- wait_for_condition (SeleniumOnRails::TestBuilderActions)
- wait_for_page_to_load (SeleniumOnRails::TestBuilderActions)
- wait_for_popup (SeleniumOnRails::TestBuilderActions)
-
-
- - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/index.html b/tracks/vendor/plugins/selenium-on-rails/doc/index.html deleted file mode 100644 index d7f62a7d..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - SeleniumOnRails - - - - - - - - - - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/doc/rdoc-style.css b/tracks/vendor/plugins/selenium-on-rails/doc/rdoc-style.css deleted file mode 100644 index fbf7326a..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/doc/rdoc-style.css +++ /dev/null @@ -1,208 +0,0 @@ - -body { - font-family: Verdana,Arial,Helvetica,sans-serif; - font-size: 90%; - margin: 0; - margin-left: 40px; - padding: 0; - background: white; -} - -h1,h2,h3,h4 { margin: 0; color: #efefef; background: transparent; } -h1 { font-size: 150%; } -h2,h3,h4 { margin-top: 1em; } - -a { background: #eef; color: #039; text-decoration: none; } -a:hover { background: #039; color: #eef; } - -/* Override the base stylesheet's Anchor inside a table cell */ -td > a { - background: transparent; - color: #039; - text-decoration: none; -} - -/* and inside a section title */ -.section-title > a { - background: transparent; - color: #eee; - text-decoration: none; -} - -/* === Structural elements =================================== */ - -div#index { - margin: 0; - margin-left: -40px; - padding: 0; - font-size: 90%; -} - - -div#index a { - margin-left: 0.7em; -} - -div#index .section-bar { - margin-left: 0px; - padding-left: 0.7em; - background: #ccc; - font-size: small; -} - - -div#classHeader, div#fileHeader { - width: auto; - color: white; - padding: 0.5em 1.5em 0.5em 1.5em; - margin: 0; - margin-left: -40px; - border-bottom: 3px solid #006; -} - -div#classHeader a, div#fileHeader a { - background: inherit; - color: white; -} - -div#classHeader td, div#fileHeader td { - background: inherit; - color: white; -} - - -div#fileHeader { - background: #057; -} - -div#classHeader { - background: #048; -} - - -.class-name-in-header { - font-size: 180%; - font-weight: bold; -} - - -div#bodyContent { - padding: 0 1.5em 0 1.5em; -} - -div#description { - padding: 0.5em 1.5em; - background: #efefef; - border: 1px dotted #999; -} - -div#description h1,h2,h3,h4,h5,h6 { - color: #125;; - background: transparent; -} - -div#validator-badges { - text-align: center; -} -div#validator-badges img { border: 0; } - -div#copyright { - color: #333; - background: #efefef; - font: 0.75em sans-serif; - margin-top: 5em; - margin-bottom: 0; - padding: 0.5em 2em; -} - - -/* === Classes =================================== */ - -table.header-table { - color: white; - font-size: small; -} - -.type-note { - font-size: small; - color: #DEDEDE; -} - -.xxsection-bar { - background: #eee; - color: #333; - padding: 3px; -} - -.section-bar { - color: #333; - border-bottom: 1px solid #999; - margin-left: -20px; -} - - -.section-title { - background: #79a; - color: #eee; - padding: 3px; - margin-top: 2em; - margin-left: -30px; - border: 1px solid #999; -} - -.top-aligned-row { vertical-align: top } -.bottom-aligned-row { vertical-align: bottom } - -/* --- Context section classes ----------------------- */ - -.context-row { } -.context-item-name { font-family: monospace; font-weight: bold; color: black; } -.context-item-value { font-size: small; color: #448; } -.context-item-desc { color: #333; padding-left: 2em; } - -/* --- Method classes -------------------------- */ -.method-detail { - background: #efefef; - padding: 0; - margin-top: 0.5em; - margin-bottom: 1em; - border: 1px dotted #ccc; -} -.method-heading { - color: black; - background: #ccc; - border-bottom: 1px solid #666; - padding: 0.2em 0.5em 0 0.5em; -} -.method-signature { color: black; background: inherit; } -.method-name { font-weight: bold; } -.method-args { font-style: italic; } -.method-description { padding: 0 0.5em 0 0.5em; } - -/* --- Source code sections -------------------- */ - -a.source-toggle { font-size: 90%; } -div.method-source-code { - background: #262626; - color: #ffdead; - margin: 1em; - padding: 0.5em; - border: 1px dashed #999; - overflow: hidden; -} - -div.method-source-code pre { color: #ffdead; overflow: hidden; } - -/* --- Ruby keyword styles --------------------- */ - -.standalone-code { background: #221111; color: #ffdead; overflow: hidden; } - -.ruby-constant { color: #7fffd4; background: transparent; } -.ruby-keyword { color: #00ffff; background: transparent; } -.ruby-ivar { color: #eedd82; background: transparent; } -.ruby-operator { color: #00ffee; background: transparent; } -.ruby-identifier { color: #ffdead; background: transparent; } -.ruby-node { color: #ffa07a; background: transparent; } -.ruby-comment { color: #b22222; font-weight: bold; background: transparent; } -.ruby-regexp { color: #ffa07a; background: transparent; } -.ruby-value { color: #7fffd4; background: transparent; } \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/USAGE b/tracks/vendor/plugins/selenium-on-rails/generators/selenium/USAGE deleted file mode 100644 index 1a6ae9f0..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/USAGE +++ /dev/null @@ -1,19 +0,0 @@ -Description: - Generates a stub Selenium test case. - -Examples: - ./script/generate selenium login - will create: - /test/selenium/login.sel - - ./script/generate selenium user/create - will create: - /test/selenium/user/create.sel - - ./script/generate selenium login.rsel - will create: - /test/selenium/login.rsel - - ./script/generate selenium logout.rhtml - will create: - /test/selenium/logout.rhtml diff --git a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/selenium_generator.rb b/tracks/vendor/plugins/selenium-on-rails/generators/selenium/selenium_generator.rb deleted file mode 100644 index bc51ef5a..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/selenium_generator.rb +++ /dev/null @@ -1,50 +0,0 @@ -class SeleniumGenerator < Rails::Generator::Base - def initialize runtime_args, runtime_options = {} - super - usage if @args.empty? - end - - def banner - "Usage: #{$0} #{spec.name} testname [options]" - end - - def manifest - record do |m| - path = 'test/selenium' - path = File.join(path, suite_path) unless suite_path.empty? - m.directory path - - template = case File.extname(filename) - when '.rhtml' then 'rhtml.rhtml' - when '.rsel' then 'rselenese.rhtml' - else 'selenese.rhtml' - end - m.template template, File.join(path, filename) - end - end - - def filename - name = File.basename args[0] - extensions = ['.sel', '.rhtml', '.rsel'] - name = "#{name}.sel" unless extensions.include? File.extname(name) - name - end - - def suite_path - sp = File.dirname args[0] - sp = '' if sp == '.' - sp - end - - def testcase_link - l = "http://localhost:3000/selenium/tests/" - l = "#{l}#{suite_path}/" unless suite_path.empty? - l + filename - end - - def suite_link - l = "http://localhost:3000/selenium" - l = "#{l}/TestRunner.html?test=tests/#{suite_path}" unless suite_path.empty? - l - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml b/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml deleted file mode 100644 index c6c4c441..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/rhtml.rhtml +++ /dev/null @@ -1,16 +0,0 @@ -

It's often a good idea to start the test with opening /selenium/setup (see <%%= link_to 'here', :controller => 'selenium', :action => 'setup' %> for more info).

- - - - -<%% for page in ['/', '/home'] -%> - - -<%% end -%> -
<%%= @page_title %>
open/selenium/setup 
open<%%= page %> 
assertTitleHome 
- -

More information about the commands is available here.

- -

You can write comments above and below the commands, but you can only have one set of commands, i.e. one table, per test.

- -

Point the browser to <%= testcase_link %> to see how this test is rendered, or to <%= suite_link %> to run the suite.

diff --git a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml b/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml deleted file mode 100644 index 419eb368..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/rselenese.rhtml +++ /dev/null @@ -1,14 +0,0 @@ -# It's often a good idea to start the test with 'setup'. -# See /selenium/setup for more info. - -setup -open '/' -assert_title 'Home' - -# More information about the commands is available at: -# http://release.openqa.org/selenium-core/nightly/reference.html -# See also the RDoc for SeleniumOnRails::TestBuilder. -# -# Point the browser to <%= testcase_link %> to see -# how this test is rendered, or to <%= suite_link %> to -# run the suite. diff --git a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml b/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml deleted file mode 100644 index f4ccb8a9..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/generators/selenium/templates/selenese.rhtml +++ /dev/null @@ -1,11 +0,0 @@ -It's often a good idea to start the test with opening /selenium/setup (see "here":/selenium/setup for more info). - -|open|/selenium/setup| -|open|/| -|assertTitle|Home| - -More information about the commands is available "here":http://release.openqa.org/selenium-core/nightly/reference.html. - -You can write comments above and below the commands, but you can only have one set of commands, i.e. one table, per test. "RedCloth":http://www.whytheluckystiff.net/ruby/redcloth/ is used for formatting if installed. - -Point the browser to "<%= testcase_link %>":<%= testcase_link %> to see how this test is rendered, or to "<%= suite_link %>":<%= suite_link %> to run the suite. diff --git a/tracks/vendor/plugins/selenium-on-rails/init.rb b/tracks/vendor/plugins/selenium-on-rails/init.rb deleted file mode 100644 index 05d43a8c..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/init.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'selenium_on_rails_config' -envs = SeleniumOnRailsConfig.get :environments - -if envs.include? RAILS_ENV - #initialize the plugin - $LOAD_PATH << File.dirname(__FILE__) + "/lib/controllers" - require 'selenium_controller' - require File.dirname(__FILE__) + '/routes' - -else - #erase all traces - $LOAD_PATH.delete lib_path - - #but help user figure out what to do - unless RAILS_ENV == 'production' # don't pollute production - require File.dirname(__FILE__) + '/switch_environment/init' - end -end - diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb b/tracks/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb deleted file mode 100644 index f6e328c8..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/controllers/selenium_controller.rb +++ /dev/null @@ -1,119 +0,0 @@ -require 'webrick/httputils' - -class SeleniumController < ActionController::Base - include SeleniumOnRails::FixtureLoader - include SeleniumOnRails::Renderer - - def setup - unless params.has_key? :keep_session - reset_session - @session_wiped = true - end - @cleared_tables = clear_tables params[:clear_tables].to_s - @loaded_fixtures = load_fixtures params[:fixtures].to_s - render :file => view_path('setup.rhtml'), :layout => layout_path - end - - def test_file - params[:testname] = '' if params[:testname].to_s == 'TestSuite.html' - filename = File.join selenium_tests_path, params[:testname] - if File.directory? filename - @suite_path = filename - render :file => view_path('test_suite.rhtml'), :layout => layout_path - elsif File.readable? filename - render_test_case filename - else - if File.directory? selenium_tests_path - render :text => 'Not found', :status => 404 - else - render :text => "Did not find the Selenium tests path (#{selenium_tests_path}). Run script/generate selenium", :status => 404 - end - end - end - - def support_file - if params[:filename].empty? - redirect_to :filename => 'TestRunner.html', :test => 'tests' - return - end - - filename = File.join selenium_path, params[:filename] - if File.file? filename - type = WEBrick::HTTPUtils::DefaultMimeTypes[$1.downcase] if filename =~ /\.(\w+)$/ - type ||= 'text/html' - send_file filename, :type => type, :disposition => 'inline', :stream => false - else - render :text => 'Not found', :status => 404 - end - end - - def record - dir = record_table - - @result = {'resultDir' => dir} - for p in ['result', 'numTestFailures', 'numTestPasses', 'numCommandFailures', 'numCommandPasses', 'numCommandErrors', 'totalTime'] - @result[p] = params[p] - end - File.open(log_path(params[:logFile] || 'default.yml'), 'w') {|f| YAML.dump(@result, f)} - - render :file => view_path('record.rhtml'), :layout => layout_path - end - - def record_table - return nil unless result_dir = SeleniumOnRailsConfig.get(:result_dir) - - cur_result_dir = File.join(result_dir, (params[:logFile] || "default").sub(/\.yml$/, '')) - FileUtils.mkdir_p(cur_result_dir) - File.open("#{cur_result_dir}/index.html", "wb") do |f| - f.write < -Selenium Test Result - - - - - -EOS - end - html_header = < - - - - -EOS - html_footer = "\n" - if selenium_path - css_file = File.join selenium_path, "selenium-test.css" - if File.exist?(css_file) - FileUtils.cp css_file, cur_result_dir - end - end - File.open("#{cur_result_dir}/blank.html", "wb") do |f| - f.write "" - end - File.open("#{cur_result_dir}/suite.html", "wb") do |f| - suite = params[:suite] - suite.sub!(/^.*(])/im, '\1') - i = 1 - suite.gsub!(/(\shref=)"[^"]*"/i) do |m| - link = "#{$1}\"test#{i}.html\" target=\"testcase\"" - File.open("#{cur_result_dir}/test#{i}.html", "wb") do |testcase| - testcase.write html_header - testcase.write(params["testTable.#{i}"]) - testcase.write html_footer - end - i += 1 - link - end - f.write html_header - f.write suite - f.write html_footer - end - cur_result_dir - end - - private :record_table - - -end diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb deleted file mode 100644 index 4e178536..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_helper.rb +++ /dev/null @@ -1,9 +0,0 @@ -module SeleniumHelper - include SeleniumOnRails::SuiteRenderer - include SeleniumOnRails::FixtureLoader - - def test_case_name filename - File.basename(filename).sub(/\..*/,'').humanize - end - -end diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb deleted file mode 100644 index 365d0034..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails.rb +++ /dev/null @@ -1,11 +0,0 @@ -module SeleniumOnRails # :nodoc -end - -require 'selenium_on_rails/selenese' -require 'selenium_on_rails/test_builder' -require 'selenium_on_rails/rselenese' -require 'selenium_on_rails/suite_renderer' -require 'selenium_on_rails/paths' -require 'selenium_on_rails/fixture_loader' -require 'selenium_on_rails/partials_support' -require 'selenium_on_rails/renderer' diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb deleted file mode 100644 index 9f1d106b..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/acceptance_test_runner.rb +++ /dev/null @@ -1,210 +0,0 @@ -require File.dirname(__FILE__) + '/paths' -require File.dirname(__FILE__) + '/../selenium_on_rails_config' -require 'net/http' -require 'tempfile' - - -def c(var, default = nil) SeleniumOnRailsConfig.get var, default end -def c_b(var, default = nil) SeleniumOnRailsConfig.get(var, default) { yield } end - -BROWSERS = c :browsers, {} -REUSE_EXISTING_SERVER = c :reuse_existing_server, true -START_SERVER = c :start_server, false #TODO can't get it to work reliably on Windows, perhaps it's just on my computer, but I leave it off by default for now -HOST = c :host, 'localhost' -PORTS = c(:port_start, 3000)..c(:port_end, 3005) -TEST_RUNNER_URL = c :test_runner_url, '/selenium/TestRunner.html' -MAX_BROWSER_DURATION = c :max_browser_duration, 2*60 -MULTI_WINDOW = c :multi_window, false -SERVER_COMMAND = c_b :server_command do - server_path = File.expand_path(File.dirname(__FILE__) + '/../../../../../script/server') - if RUBY_PLATFORM =~ /mswin/ - "ruby #{server_path} -p %d -e test > NUL 2>&1" - else - # don't use redirects to /dev/nul since it makes the fork return wrong pid - # see UnixSubProcess - "#{server_path} -p %d -e test" - end -end - -module SeleniumOnRails - class AcceptanceTestRunner - include SeleniumOnRails::Paths - - def run - raise 'no browser specified, edit/create config.yml' if BROWSERS.empty? - start_server - has_error = false - begin - BROWSERS.each_pair do |browser, path| - log_file = start_browser browser, path - wait_for_completion log_file - stop_browser - result = YAML::load_file log_file - print_result result - has_error ||= result['numTestFailures'].to_i > 0 - File.delete log_file unless has_error - end - rescue - stop_server - raise - end - stop_server - raise 'Test failures' if has_error - end - - private - def start_server - PORTS.each do |p| - @port = p - case server_check - when :success - return if REUSE_EXISTING_SERVER - next - when Fixnum - next - when :no_response - next unless START_SERVER - do_start_server - return - end - end - raise START_SERVER ? 'failed to start server': 'failed to find existing server, run script/server -e test' - end - - def do_start_server - puts 'Starting server' - @server = start_subprocess(format(SERVER_COMMAND, @port)) - while true - print '.' - r = server_check - if r == :success - puts - return - end - raise "server returned error: #{r}" if r.instance_of? Fixnum - sleep 3 - end - end - - def server_check - begin - res = Net::HTTP.get_response HOST, TEST_RUNNER_URL, @port - return :success if (200..399).include? res.code.to_i - return res.code.to_i - rescue Errno::ECONNREFUSED - return :no_response - end - end - - def stop_server - return unless defined? @server - puts - @server.stop 'server' - end - - def start_browser browser, path - puts - puts "Starting #{browser}" - log = log_file browser - command = "\"#{path}\" \"http://#{HOST}:#{@port}#{TEST_RUNNER_URL}?test=tests&auto=true&resultsUrl=postResults/#{log}&multiWindow=#{MULTI_WINDOW}\"" - @browser = start_subprocess command - log_path log - end - - def stop_browser - @browser.stop 'browser' - end - - def start_subprocess command - if RUBY_PLATFORM =~ /mswin/ - SeleniumOnRails::AcceptanceTestRunner::Win32SubProcess.new command - elsif RUBY_PLATFORM =~ /darwin/i && command =~ /safari/i - SeleniumOnRails::AcceptanceTestRunner::SafariSubProcess.new command - else - SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess.new command - end - end - - def log_file browser - (0..100).each do |i| - name = browser + (i==0 ? '' : "(#{i})") + '.yml' - return name unless File.exist?(log_path(name)) - end - raise 'there are way too many files in the log directory...' - end - - def wait_for_completion log_file - duration = 0 - while true - raise 'browser takes too long' if duration > MAX_BROWSER_DURATION - print '.' - break if File.exist? log_file - sleep 5 - duration += 5 - end - puts - end - - def print_result result - puts "Finished in #{result['totalTime']} seconds." - puts - puts "#{result['numTestPasses']} tests passed, #{result['numTestFailures']} tests failed" - puts "(Results stored in '#{result['resultDir']}')" if result['resultDir'] - end - - end -end - -class SeleniumOnRails::AcceptanceTestRunner::SubProcess - def stop what - begin - puts "Stopping #{what} (pid=#{@pid}) ..." - Process.kill 9, @pid - rescue Errno::EPERM #such as the process is already closed (tabbed browser) - end - end -end - -class SeleniumOnRails::AcceptanceTestRunner::Win32SubProcess < SeleniumOnRails::AcceptanceTestRunner::SubProcess - def initialize command - require 'win32/open3' #win32-open3 http://raa.ruby-lang.org/project/win32-open3/ - - puts command - input, output, error, @pid = Open4.popen4 command, 't', true - end -end - -class SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess < SeleniumOnRails::AcceptanceTestRunner::SubProcess - def initialize command - puts command - @pid = fork do - # Since we can't use shell redirects without screwing - # up the pid, we'll reopen stdin and stdout instead - # to get the same effect. - [STDOUT,STDERR].each {|f| f.reopen '/dev/null', 'w' } - exec command - end - end -end - -# The path to Safari should look like this: /Applications/Safari.app/Contents/MacOS/Safari -class SeleniumOnRails::AcceptanceTestRunner::SafariSubProcess < SeleniumOnRails::AcceptanceTestRunner::UnixSubProcess - def initialize command - f = File.open(Tempfile.new('selenium-on-rails').path, 'w') - f.puts <<-HTML - - - - - - - HTML - f.close - - super "#{command.split.first} #{f.path}" - end - -end - diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb deleted file mode 100644 index c4d513cc..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/fixture_loader.rb +++ /dev/null @@ -1,54 +0,0 @@ -require 'active_record/fixtures' - -module SeleniumOnRails::FixtureLoader - include SeleniumOnRails::Paths - - def available_fixtures - fixtures = {} - path = fixtures_path + '/' - files = Dir["#{path}**/*.{yml,csv}"] - files.each do |file| - rel_path = file.sub(path, '') - next if skip_file? rel_path - fixture_set = File.dirname(rel_path) - fixture_set = '' if fixture_set == '.' - fixture = rel_path.sub /\.[^.]*$/, '' - fixtures[fixture_set] ||= [] - fixtures[fixture_set] << fixture - end - - fixtures - end - - def load_fixtures fixtures_param - available = nil - fixtures = fixtures_param.split(/\s*,\s*/).collect do |f| - fixture_set = File.dirname f - fixture_set = '' if fixture_set == '.' - fixture = File.basename f - if fixture == 'all' - available ||= available_fixtures - available[fixture_set] - else - f - end - end - fixtures.flatten! - fixtures.reject! {|f| f.blank? } - - if fixtures.any? - Fixtures.create_fixtures fixtures_path, fixtures - end - fixtures - end - - def clear_tables tables - table_names = tables.split /\s*,\s*/ - connection = ActiveRecord::Base.connection - table_names.each do |table| - connection.execute "DELETE FROM #{table}" - end - table_names - end - -end diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb deleted file mode 100644 index 4374c4e9..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/partials_support.rb +++ /dev/null @@ -1,38 +0,0 @@ -# Provides partials support to test cases so they can include other partial test -# cases. -# -# The partial's commands are returned as html table rows. -module SeleniumOnRails::PartialsSupport - include SeleniumOnRails::Paths - - # Overrides where the partial is searched for, and returns only the command table rows. - def render_partial partial_path = default_template_name, object = nil, local_assigns = nil, status = nil - pattern = partial_pattern partial_path - filename = Dir[pattern].first - raise "Partial '#{partial_path}' cannot be found! (Looking for file: '#{pattern}')" unless filename - partial = render :file => filename, :use_full_path => false, :locals => local_assigns - extract_commands_from_partial partial - end - - # Extracts the commands from a partial. The partial must contain a html table - # and the first row is ignored since it cannot contain a command. - def extract_commands_from_partial partial - partial = partial.match(/.*.*?.*?<\/tr>(.*?)<\/table>/im)[1] - raise "Partial '#{name}' doesn't contain any table" unless partial - partial - end - - private - # Generates the file pattern from the provided partial path. - # The starting _ and file extension don't have too be provided. - def partial_pattern partial_path - path = partial_path.split '/' - filename = path.delete_at(-1) - filename = '_' + filename unless filename.starts_with? '_' - filename << '.*' unless filename.include? '.' - pattern = selenium_tests_path + '/' - pattern << path.join('/') + '/' if path - pattern << filename - end - -end \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb deleted file mode 100644 index 03dfc7f2..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/paths.rb +++ /dev/null @@ -1,61 +0,0 @@ -module SeleniumOnRails - module Paths - def selenium_path - @@selenium_path ||= find_selenium_path - @@selenium_path - end - - def selenium_tests_path - File.expand_path(File.join(RAILS_ROOT, 'test/selenium')) - end - - def view_path view - File.expand_path(File.dirname(__FILE__) + '/../views/' + view) - end - - # Returns the path to the layout template. The path is relative in relation - # to the app/views/ directory since Rails doesn't support absolute paths - # to layout templates. - def layout_path - rails_root = Pathname.new File.expand_path(File.join(RAILS_ROOT, 'app/views')) - view_path = Pathname.new view_path('layout') - view_path.relative_path_from(rails_root).to_s - end - - def fixtures_path - File.expand_path File.join(RAILS_ROOT, 'test/fixtures') - end - - def log_path log_file - File.expand_path(File.dirname(__FILE__) + '/../../log/' + File.basename(log_file)) - end - - def skip_file? file - file.split('/').each do |f| - return true if f.upcase == 'CVS' or f.starts_with?('.') or f.ends_with?('~') or f.starts_with?('_') - end - false - end - - private - def find_selenium_path - sel_dirs = SeleniumOnRailsConfig.get :selenium_path do - ds = [File.expand_path(File.join(RAILS_ROOT, 'vendor/selenium')), - File.expand_path(File.join(RAILS_ROOT, 'vendor/selenium-core'))] - gems = Gem.source_index.find_name 'selenium', nil - ds << gems.last.full_gem_path unless gems.empty? - ds - end - - sel_dirs.to_a.each do |seleniumdir| - ['', 'core', 'selenium', 'javascript'].each do |subdir| - path = File.join seleniumdir, subdir - return path if File.exist?(File.join(path, 'TestRunner.html')) - end - end - - raise 'Could not find Selenium Core installation' - end - - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb deleted file mode 100644 index f49f3162..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/renderer.rb +++ /dev/null @@ -1,17 +0,0 @@ -module SeleniumOnRails::Renderer - include SeleniumOnRails::Paths - include SeleniumHelper - - def render_test_case filename - @template.extend SeleniumOnRails::PartialsSupport - @page_title = test_case_name filename - output = render_to_string :file => filename - layout = (output =~ //i ? false : layout_path) - render :text => output, :layout => layout - - headers['Cache-control'] = 'no-cache' - headers['Pragma'] = 'no-cache' - headers['Expires'] = '-1' - end - -end \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb deleted file mode 100644 index fea4a57c..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/rselenese.rb +++ /dev/null @@ -1,35 +0,0 @@ -# Renders Selenium test templates in a fashion analogous to +rxml+ and -# +rjs+ templates. -# -# setup -# open :controller => 'customer', :action => 'list' -# assert_title 'Customers' -# -# See SeleniumOnRails::TestBuilder for a list of available commands. -class SeleniumOnRails::RSelenese < SeleniumOnRails::TestBuilder -end -ActionView::Base.register_template_handler 'rsel', SeleniumOnRails::RSelenese - -class SeleniumOnRails::RSelenese < SeleniumOnRails::TestBuilder - attr_accessor :view - - # Create a new RSelenese renderer bound to _view_. - def initialize view - super view - @view = view - end - - # Render _template_ using _local_assigns_. - def render template, local_assigns - title = (@view.assigns['page_title'] or local_assigns['page_title']) - table(title) do - test = self #to enable test.command - - assign_locals_code = '' - local_assigns.each_key {|key| assign_locals_code << "#{key} = local_assigns[#{key.inspect}];"} - - eval assign_locals_code + "\n" + template - end - end - -end \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb deleted file mode 100644 index 4f9e4524..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/selenese.rb +++ /dev/null @@ -1,81 +0,0 @@ -class SeleniumOnRails::Selenese -end -ActionView::Base.register_template_handler 'sel', SeleniumOnRails::Selenese - - -class SeleniumOnRails::Selenese - def initialize view - @view = view - end - - def render template, local_assigns - name = (@view.assigns['page_title'] or local_assigns['page_title']) - lines = template.strip.split "\n" - html = '' - html << extract_comments(lines) - html << extract_commands(lines, name) - html << extract_comments(lines) - raise 'You cannot have comments in the middle of commands!' if next_line lines, :any - html - end - - private - def next_line lines, expects - while lines.any? - l = lines.shift.strip - next if (l.empty? and expects != :comment) - comment = (l =~ /^\|.*\|$/).nil? - if (comment and expects == :command) or (!comment and expects == :comment) - lines.unshift l - return nil - end - return l - end - end - - def extract_comments lines - comments = '' - while (line = next_line lines, :comment) - comments << line + "\n" - end - if defined? RedCloth - comments = RedCloth.new(comments).to_html - end - comments += "\n" unless comments.empty? - comments - end - - def extract_commands lines, name - html = "
\n\n" - while (line = next_line lines, :command) - line = line[1..-2] #remove starting and ending | - cells = line.split '|' - if cells.first == 'includePartial' - html << include_partial(cells[1..-1]) - next - end - raise 'There might only be a maximum of three cells!' if cells.length > 3 - html << '' - (1..3).each do - cell = cells.shift - cell = (cell ? CGI.escapeHTML(cell.strip) : ' ') - html << "" - end - html << "\n" - end - html << "
#{name}
#{cell}
\n" - end - - def include_partial params - partial = params.shift - locals = {} - params.each do |assignment| - next if assignment.empty? - _, var, value = assignment.split(/^([a-z_][a-zA-Z0-9_]*)\s*=\s*(.*)$/) - raise "Invalid format '#{assignment}'. Should be '|includePartial|partial|var1=value|var2=value|." unless var - locals[var.to_sym] = value or '' - end - @view.render :partial => partial, :locals => locals - end - -end \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb deleted file mode 100644 index 10f87771..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/suite_renderer.rb +++ /dev/null @@ -1,51 +0,0 @@ -module SeleniumOnRails::SuiteRenderer - def test_suite_name path - return 'All test cases' if [nil, '/'].include? path_to_relative_url(path) - File.split(path)[-1].humanize - end - - def test_suites path - suites = [] - - parent_path = File.join(File.split(path).slice(0..-2)) #all but last - parent_path = path_to_relative_url parent_path - suites << ['..', parent_path] unless parent_path.nil? - - visit_all_tests path, '', Proc.new {|n, p| suites << [n,path_to_relative_url(p)]}, nil - suites - end - - def test_cases path - tests = [] - visit_all_tests path, '', nil, Proc.new {|n, p| tests << [n,p]} - tests - end - - def link_to_test_case suite_name, filename - name = suite_name + test_case_name(filename) - link_to name, :action => :test_file, :testname => path_to_relative_url(filename).sub(/^\//,'') - end - - private - def path_to_relative_url path - slt = @controller.selenium_tests_path - return nil unless path.index slt - path.sub slt, '' - end - - def visit_all_tests path, suite_name, suite_consumer, test_consumer - dirs = [] #add dirs to an array in order for files to be processed before dirs - Dir.entries(path).sort.each do |e| - next if skip_file?(e) or ['.','..'].include?(e) - filename = File.join path, e - if File.directory? filename - dirs << [filename, "#{suite_name}#{e.humanize}."] - suite_consumer.call("#{suite_name}#{e.humanize}", filename) if suite_consumer - else - test_consumer.call(suite_name, filename) if test_consumer - end - end - #recurse through dirs - dirs.each {|p, n| visit_all_tests p, n, suite_consumer, test_consumer } - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb deleted file mode 100644 index c2a33078..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder.rb +++ /dev/null @@ -1,92 +0,0 @@ -# Builds Selenium test table using a high-level Ruby interface. Normally -# invoked through SeleniumOnRails::RSelenese. -# -# See SeleniumOnRails::TestBuilderActions for the available actions and -# SeleniumOnRails::TestBuilderAccessors for the available checks. -# -# For more information on the commands supported by TestBuilder, see the -# Selenium Commands Documentation at -# http://release.openqa.org/selenium-core/nightly/reference.html. -class SeleniumOnRails::TestBuilder - include SeleniumOnRails::TestBuilderActions - include SeleniumOnRails::TestBuilderAccessors - - # Convert _str_ to a Selenium command name. - def self.selenize str - str.camelize.gsub(/^[A-Z]/) {|s| s.downcase } - end - - # Prepends _pattern_ with 'exact:' if it would be considered containing - # string-match pattern otherwise. - def exactize pattern - pattern.include?(':') ? "exact:#{pattern}" : pattern - end - - # Create a new TestBuilder for _view_. - def initialize view - @view = view - @output = '' - @xml = Builder::XmlMarkup.new :indent => 2, :target => @output - end - - # Add a new table of tests, and return the HTML. - def table title - @xml.table do - @xml.tr do @xml.th(title, :colspan => 3) end - yield self - end - end - - # Add a new test command using _cmd_, _target_ and _value_. - def command cmd, target=nil, value=nil - @xml.tr do - _tdata cmd - _tdata target - _tdata value - end - end - # :nodoc - alias_method :command_verbatim, :command - - # Same as _command_ but add _AndWait_ to the name of _cmd_. - def command_and_wait cmd, target=nil, value=nil - command_verbatim cmd.to_s + 'AndWait', target, value - end - - # Re routes commands in the provided block to #command_and_wait instead of - # #command. - def make_command_waiting - self.class.send :alias_method, :command, :command_and_wait - yield - self.class.send :alias_method, :command, :command_verbatim - end - -protected - - # If _url_ is a string, return unchanged. Otherwise, pass it to - # ActionView#UrlHelper#url_for. - def url_arg url - if url.instance_of?(String) then url else exactize(@view.url_for(url)) end - end - - # If _arg_ is an array formats _arg_ to a textual representation. - # Otherwise return unchanged. - def collection_arg arg - if arg.is_a? Array - arg.collect {|e| e.gsub(/[\\,]/) {|s| "\\#{s}" } }.join(',') - else - arg - end - end - -private - - # Output a single TD element. - def _tdata value - if value - @xml.td(value.to_s) - else - @xml.td do @xml.target! << ' ' end - end - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb deleted file mode 100644 index 6c892770..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_accessors.rb +++ /dev/null @@ -1,575 +0,0 @@ -# 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 - # Has an alert occurred? - # - # Related Assertions, automatically generated: - # * +assert_alert_present+ - # * +assert_alert_not_present+ - # * +verify_alert_present+ - # * +verify_alert_not_present+ - # * +wait_for_alert_present+ - # * +wait_for_alert_not_present+ - def store_alert_present variable_name - command 'storeAlertPresent', variable_name - end - - # Has a prompt occurred? - # - # Related Assertions, automatically generated: - # * +assert_prompt_present+ - # * +assert_prompt_not_present+ - # * +verify_prompt_present+ - # * +verify_prompt_not_present+ - # * +wait_for_prompt_present+ - # * +wait_for_prompt_not_present+ - def store_prompt_present variable_name - command 'storePromptPresent', variable_name - end - - # Has confirm() been called? - # - # Related Assertions, automatically generated: - # * +assert_confirmation_present+ - # * +assert_confirmation_not_present+ - # * +verify_confirmation_present+ - # * +verify_confirmation_not_present+ - # * +wait_for_confirmation_present+ - # * +wait_for_confirmation_not_present+ - def store_confirmation_present variable_name - command 'storeConfirmationPresent', variable_name - end - - # Retrieves the message of a JavaScript alert generated during the previous - # action, or fail if there were no alerts. - # - # Getting an alert has the same effect as manually clicking OK. If an alert - # is generated but you do not get/verify it, the next Selenium action will - # fail. - # - # NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert - # dialog. - # - # NOTE: Selenium does NOT support JavaScript alerts that are generated in a - # page's onload() event handler. In this case a visible dialog WILL be - # generated and Selenium will hang until someone manually clicks OK. - # - # Related Assertions, automatically generated: - # * assert_alert(pattern) - # * assert_not_alert(pattern) - # * verify_alert_present(pattern) - # * verify_not_alert(pattern) - # * wait_for_alert(pattern) - # * wait_for_not_alert(pattern) - def store_alert variable_name - command 'storeAlert', variable_name - end - - # Retrieves the message of a JavaScript confirmation dialog generated during - # the previous action. - # - # By default, the confirm function will return +true+, having the same effect - # as manually clicking OK. This can be changed by prior execution of the - # +choose_cancel_on_next_confirmation+ command. If a confirmation is - # generated but you do not get/verify it, the next Selenium action will fail. - # - # NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible - # dialog. - # - # NOTE: Selenium does NOT support JavaScript confirmations that are generated - # in a page's onload() event handler. In this case a visible dialog WILL be - # generated and Selenium will hang until you manually click OK. - # - # Related Assertions, automatically generated: - # * assert_confirmation(pattern) - # * assert_not_confirmation(pattern) - # * verify_confirmation_present(pattern) - # * verify_not_confirmation(pattern) - # * wait_for_confirmation(pattern) - # * wait_for_not_confirmation(pattern) - def store_confirmation variable_name - command 'storeConfirmation', variable_name - end - - # Retrieves the message of a JavaScript question prompt dialog generated - # during the previous action. - # - # Successful handling of the prompt requires prior execution of the - # +answer_on_next_prompt+ command. If a prompt is generated but you do not - # get/verify it, the next Selenium action will fail. - # - # NOTE: under Selenium, JavaScript prompts will NOT pop up a visible dialog. - # - # NOTE: Selenium does NOT support JavaScript prompts that are generated in a - # page's onload() event handler. In this case a visible dialog WILL be - # generated and Selenium will hang until someone manually clicks OK. - # - # Related Assertions, automatically generated: - # * assert_prompt(pattern) - # * assert_not_prompt(pattern) - # * verify_prompt_present(pattern) - # * verify_not_prompt(pattern) - # * wait_for_prompt(pattern) - # * wait_for_not_prompt(pattern) - def store_prompt variable_name - command 'storePrompt', variable_name - end - - # Gets the absolute URL of the current page. - # - # Related Assertions, automatically generated: - # * assert_absolute_location(pattern) - # * assert_not_absolute_location(pattern) - # * verify_absolute_location_present(pattern) - # * verify_not_absolute_location(pattern) - # * wait_for_absolute_location(pattern) - # * wait_for_not_absolute_location(pattern) - def store_absolute_location variable_name - command 'storeAbsoluteLocation', variable_name - end - - # Verify the location of the current page ends with the expected location. - # If an URL querystring is provided, this is checked as well. - # - # Related Assertions, automatically generated: - # * assert_location(pattern) - # * assert_not_location(pattern) - # * verify_location_present(pattern) - # * verify_not_location(pattern) - # * wait_for_location(pattern) - # * wait_for_not_location(pattern) - def store_location expected_location, variable_name - command 'storeLocation', expected_location, variable_name - end - - # Gets the title of the current page. - # - # Related Assertions, automatically generated: - # * assert_title(pattern) - # * assert_not_title(pattern) - # * verify_title_present(pattern) - # * verify_not_title(pattern) - # * wait_for_title(pattern) - # * wait_for_not_title(pattern) - def store_title variable_name - command 'storeTitle', variable_name - end - - # Gets the entire text of the page. - # - # Related Assertions, automatically generated: - # * assert_body_text(pattern) - # * assert_not_body_text(pattern) - # * verify_body_text_present(pattern) - # * verify_not_body_text(pattern) - # * wait_for_body_text(pattern) - # * wait_for_not_body_text(pattern) - def store_body_text variable_name - command 'storeBodyText', variable_name - end - - # Gets the (whitespace-trimmed) value of an input field (or anything else - # with a value parameter). For checkbox/radio elements, the value will be - # "on" or "off" depending on whether the element is checked or not. - # - # Related Assertions, automatically generated: - # * assert_value(locator, pattern) - # * assert_not_value(locator, pattern) - # * verify_value_present(locator, pattern) - # * verify_not_value(locator, pattern) - # * wait_for_value(locator, pattern) - # * wait_for_not_value(locator, pattern) - def store_value locator, variable_name - command 'storeValue', locator, variable_name - end - - # Gets the text of an element. This works for any element that contains text. - # This command uses either the +textContent+ (Mozilla-like browsers) or the - # +innerText+ (IE-like browsers) of the element, which is the rendered text - # shown to the user. - # - # Related Assertions, automatically generated: - # * assert_text(locator, pattern) - # * assert_not_text(locator, pattern) - # * verify_text_present(locator, pattern) - # * verify_not_text(locator, pattern) - # * wait_for_text(locator, pattern) - # * wait_for_not_text(locator, pattern) - def store_text locator, variable_name - command 'storeText', locator, variable_name - end - - # Gets the result of evaluating the specified JavaScript snippet. The snippet - # may have multiple lines, but only the result of the last line will be - # returned. - # - # Note that, by default, the snippet will run in the context of the - # "selenium" object itself, so +this+ will refer to the Selenium object, and - # +window+ will refer to the top-level runner test window, not the window of - # your application. - # - # If you need a reference to the window of your application, you can refer to - # this.browserbot.getCurrentWindow() and if you need to use a locator to - # refer to a single element in your application page, you can use - # this.page().findElement("foo") where "foo" is your locator. - # - # Related Assertions, automatically generated: - # * assert_eval(script, pattern) - # * assert_not_eval(script, pattern) - # * verify_eval_present(script, pattern) - # * verify_not_eval(script, pattern) - # * wait_for_eval(script, pattern) - # * wait_for_not_eval(script, pattern) - def store_eval script, variable_name - command 'storeEval', script, variable_name - end - - # Gets whether a toggle-button (checkbox/radio) is checked. Fails if the - # specified element doesn't exist or isn't a toggle-button. - # - # Related Assertions, automatically generated: - # * assert_checked(locator, pattern) - # * assert_not_checked(locator, pattern) - # * verify_checked_present(locator, pattern) - # * verify_not_checked(locator, pattern) - # * wait_for_checked(locator, pattern) - # * wait_for_not_checked(locator, pattern) - def store_checked locator, variable_name - command 'storeChecked', locator, variable_name - end - - # Gets the text from a cell of a table. - # - # Related Assertions, automatically generated: - # * assert_table(locator, row, column, pattern) - # * assert_not_table(locator, row, column, pattern) - # * verify_table_present(locator, row, column, pattern) - # * verify_not_table(locator, row, column, pattern) - # * wait_for_table(locator, row, column, pattern) - # * wait_for_not_table(locator, row, column, pattern) - def store_table locator, row, column, variable_name - command 'storeTable', "#{locator}.#{row}.#{column}", variable_name - end - - # Verifies that the selected option of a drop-down satisfies the - # +option_locator+. - # - # +option_locator+ is typically just an option label (e.g. "John Smith"). - # - # See the +select+ command for more information about option locators. - # - # NOTE: +store_selected+ is currently not supported by Selenium Core. - # - # Related Assertions, automatically generated: - # * assert_selected(locator, option_locator) - # * assert_not_selected(locator, option_locator) - # * verify_selected_present(locator, option_locator) - # * verify_not_selected(locator, option_locator) - # * wait_for_selected(locator, option_locator) - # * wait_for_not_selected(locator, option_locator) - def store_selected locator, option_locator, variable_name - raise 'Not supported in Selenium Core at the moment' - end - - # Gets all option labels for selected options in the specified select or - # multi-select element. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_selected_options 'fruits', ['apple', 'pear'] - # assert_selected_options 'fruits', 'a*,p*' - # - # Related Assertions, automatically generated: - # * assert_selected_options(locator, pattern) - # * assert_not_selected_options(locator, pattern) - # * verify_selected_options_present(locator, pattern) - # * verify_not_selected_options(locator, pattern) - # * wait_for_selected_options(locator, pattern) - # * wait_for_not_selected_options(locator, pattern) - def store_selected_options locator, variable_name - command 'storeSelectedOptions', locator, variable_name - end - - # Gets all option labels in the specified select drop-down. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_select_options 'fruits', ['apple', 'pear'] - # assert_select_options 'fruits', 'a*,p*' - # - # Related Assertions, automatically generated: - # * assert_select_options(locator, pattern) - # * assert_not_select_options(locator, pattern) - # * verify_select_options_present(locator, pattern) - # * verify_not_select_options(locator, pattern) - # * wait_for_select_options(locator, pattern) - # * wait_for_not_select_options(locator, pattern) - def store_select_options locator, variable_name - command 'storeSelectOptions', locator, variable_name - end - - # Gets the value of an element attribute. - # - # Related Assertions, automatically generated: - # * assert_attribute(locator, attribute_name, pattern) - # * assert_not_attribute(locator, attribute_name, pattern) - # * verify_attribute_present(locator, attribute_name, pattern) - # * verify_not_attribute(locator, attribute_name, pattern) - # * wait_for_attribute(locator, attribute_name, pattern) - # * wait_for_not_attribute(locator, attribute_name, pattern) - def store_attribute locator, attribute_name, variable_name - command 'storeAttribute', "#{locator}@#{attribute_name}", variable_name - end - - # Verifies that the specified text pattern appears somewhere on the rendered - # page shown to the user. - # - # Related Assertions, automatically generated: - # * assert_text_present(pattern) - # * assert_text_not_present(pattern) - # * verify_text_present(pattern) - # * verify_text_not_present(pattern) - # * wait_for_text_present(pattern) - # * wait_for_text_not_present(pattern) - def store_text_present pattern, variable_name - command 'storeTextPresent', pattern, variable_name - end - - # Verifies that the specified element is somewhere on the page. - # - # Related Assertions, automatically generated: - # * assert_element_present(locator) - # * assert_element_not_present(locator) - # * verify_element_present(locator) - # * verify_element_not_present(locator) - # * wait_for_element_present(locator) - # * wait_for_element_not_present(locator) - def store_element_present locator, variable_name - command 'storeElementPresent', locator, variable_name - end - - # Determines if the specified element is visible. An element can be rendered - # invisible by setting the CSS "visibility" property to "hidden", or the - # "display" property to "none", either for the element itself or one if its - # ancestors. This method will fail if the element is not present. - # - # Related Assertions, automatically generated: - # * assert_visible(locator) - # * assert_not_visible(locator) - # * verify_visible(locator) - # * verify_not_visible(locator) - # * wait_for_visible(locator) - # * wait_for_not_visible(locator) - def store_visible locator, variable_name - command 'storeVisible', locator, variable_name - end - - # Determines whether the specified input element is editable, i.e. hasn't - # been disabled. This method will fail if the specified element isn't an - # input element. - # - # Related Assertions, automatically generated: - # * assert_editable(locator) - # * assert_not_editable(locator) - # * verify_editable(locator) - # * verify_not_editable(locator) - # * wait_for_editable(locator) - # * wait_for_not_editable(locator) - def store_editable locator, variable_name - command 'storeEditable', locator, variable_name - end - - # Returns the IDs of all buttons on the page. - # - # If a given button has no ID, it will appear as "" in this array. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_all_buttons ['but1', 'but2'] - # assert_all_buttons 'but?,but?*' - # - # Related Assertions, automatically generated: - # * assert_all_buttons(pattern) - # * assert_not_all_buttons(pattern) - # * verify_all_buttons(pattern) - # * verify_not_all_buttons(pattern) - # * wait_for_all_buttons(pattern) - # * wait_for_not_all_buttons(pattern) - def store_all_buttons variable_name - command 'storeAllButtons', variable_name - end - - # Returns the IDs of all links on the page. - # - # If a given link has no ID, it will appear as "" in this array. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_all_links ['link1', 'link2'] - # assert_all_links 'link?,link?*' - # - # Related Assertions, automatically generated: - # * assert_all_links(pattern) - # * assert_not_all_links(pattern) - # * verify_all_links(pattern) - # * verify_not_all_links(pattern) - # * wait_for_all_links(pattern) - # * wait_for_not_all_links(pattern) - def store_all_links variable_name - command 'storeAllLinks', variable_name - end - - # Returns the IDs of all input fields on the page. - # - # If a given field has no ID, it will appear as "" in this array. - # - # The +pattern+ for the automatically generated assertions can either take an - # array or a pattern. - # assert_all_fields ['field1', 'field2'] - # assert_all_fields 'field?,field?*' - # - # Related Assertions, automatically generated: - # * assert_all_fields(pattern) - # * assert_not_all_fields(pattern) - # * verify_all_fields(pattern) - # * verify_not_all_fields(pattern) - # * wait_for_all_fields(pattern) - # * wait_for_not_all_fields(pattern) - def store_all_fields variable_name - command 'storeAllFields', variable_name - end - - # Returns the entire HTML source between the opening and closing "html" tags. - # - # Related Assertions, automatically generated: - # * assert_html_source(pattern) - # * assert_not_html_source(pattern) - # * verify_html_source(pattern) - # * verify_not_html_source(pattern) - # * wait_for_html_source(pattern) - # * wait_for_not_html_source(pattern) - def store_html_source variable_name - command 'storeHtmlSource', variable_name - end - - # Returns the specified expression. - # - # This is useful because of JavaScript preprocessing. - # - # Related Assertions, automatically generated: - # * assert_expression(expression, pattern) - # * assert_not_expression(expression, pattern) - # * verify_expression(expression, pattern) - # * verify_not_expression(expression, pattern) - # * wait_for_expression(expression, pattern) - # * wait_for_not_expression(expression, pattern) - def store_expression expression, variable_name - command 'storeExpression', expression, variable_name - end - -private - # Generates all assertions for the accessors. - def self.generate_methods - public_instance_methods.each do |method| - case method - when 'store_alert_present', - 'store_prompt_present', - 'store_confirmation_present' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do - command command_name - end - end - when 'store_alert', - 'store_confirmation', - 'store_prompt', - 'store_title', - 'store_body_text', - 'store_text_present', - 'store_element_present', - 'store_visible', - 'store_editable', - 'store_html_source' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |pattern| - command command_name, pattern - end - end - when 'store_value', - 'store_text', - 'store_eval', - 'store_checked', - 'store_selected', - 'store_expression' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |arg1, arg2| - command command_name, arg1, arg2 - end - end - when 'store_all_buttons', - 'store_all_links', - 'store_all_fields' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |pattern| - command command_name, collection_arg(pattern) - end - end - when 'store_select_options', - 'store_selected_options' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |locator, pattern| - command command_name, locator, collection_arg(pattern) - end - end - when 'store_attribute' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |locator, attribute_name, pattern| - command command_name, "#{locator}@#{attribute_name}", pattern - end - end - when 'store_table' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |locator, row, column, pattern| - command command_name, "#{locator}.#{row}.#{column}", pattern - end - end - when 'store_absolute_location', - 'store_location' - each_assertion method do |assertion_method, command_name| - define_method assertion_method do |pattern| - if method == 'store_absolute_location' and pattern.is_a? Hash - pattern[:only_path] = false - end - - command command_name, url_arg(pattern) - end - end - when /^store_/ - raise 'internal error' - end - end - end - - # Generates all the assertions needed given a +store_method+. - def self.each_assertion store_method - before_negation = nil - after_negation = store_method.split('_')[1..-1] #throw away 'store' - if after_negation.last == 'present' - before_negation, after_negation = after_negation, after_negation.pop - end - - ['assert', 'verify', ['wait','for']].each do |action| - [nil, 'not'].each do |negation| - name = [action, before_negation, negation, after_negation].flatten.reject{|a|a.nil?} - method_name = name.join '_' - command = name.inject(name.shift.clone) {|n, p| n << p.capitalize} - yield method_name, command - end - end - end - - generate_methods -end - diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb deleted file mode 100644 index 65c272d1..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails/test_builder_actions.rb +++ /dev/null @@ -1,286 +0,0 @@ -# The actions available for SeleniumOnRails::TestBuilder tests. -# -# For each action +foo+ there's also an action +foo_and_wait+. -module SeleniumOnRails::TestBuilderActions - # Tell Selenium on Rails to clear the session and load any fixtures. DO - # NOT CALL THIS AGAINST NON-TEST DATABASES. - # The supported +options+ are :keep_session, - # :fixtures and :clear_tables - # setup - # setup :keep_session - # setup :fixtures => :all - # setup :keep_session, :fixtures => [:foo, :bar] - # setup :clear_tables => [:foo, :bar] - def setup options = {} - options = {options => nil} unless options.is_a? Hash - - opts = {:controller => 'selenium', :action => 'setup'} - opts[:keep_session] = true if options.has_key? :keep_session - - [:fixtures, :clear_tables].each do |key| - if (f = options[key]) - f = [f] unless f.is_a? Array - opts[key] = f.join ',' - end - end - - open opts - end - - # Includes a partial. - # The path is relative to the Selenium tests root. The starting _ and the file - # extension don't have to be specified. - # #include test/selenium/_partial.* - # include_partial 'partial' - # #include test/selenium/suite/_partial.* - # include_partial 'suite/partial' - # #include test/selenium/suite/_partial.* and provide local assigns - # include_partial 'suite/partial', :foo => bar - def include_partial path, local_assigns = {} - partial = @view.render :partial => path, :locals => local_assigns - @output << partial - end - - # Clicks on a link, button, checkbox or radio button. If the click action - # causes a new page to load (like a link usually does), call - # +wait_for_page_to_load+. - def click locator - command 'click', locator - end - - # Explicitly simulate an event (e.g. "focus", "blur"), to - # trigger the corresponding "on_event_" handler. - def fire_event locator, event_name - command 'fireEvent', locator, event_name - end - - # Simulates a user pressing and releasing a key. - # - # +keycode+ is the numeric keycode of the key to be pressed, normally the - # ASCII value of that key. - def key_press locator, keycode - command 'keyPress', locator, keycode - end - - # Simulates a user pressing a key (without releasing it yet). - # - # +keycode+ is the numeric keycode of the key to be pressed, normally the - # ASCII value of that key. - def key_down locator, keycode - command 'keyDown', locator, keycode - end - - # Simulates a user releasing a key. - # - # +keycode+ is the numeric keycode of the key to be released, normally the - # ASCII value of that key. - def key_up locator, keycode - command 'keyUp', locator, keycode - end - - # Simulates a user hovering a mouse over the specified element. - def mouse_over locator - command 'mouseOver', locator - end - - # Simulates a user pressing the mouse button (without releasing it yet) on the - # specified element. - def mouse_down locator - command 'mouseDown', locator - end - - # Sets the value of an input field, as though you typed it in. - # - # Can also be used to set the value of combo boxes, check boxes, etc. In these - # cases, +value+ should be the value of the option selected, not the visible - # text. - def type locator, value - command 'type', locator, value - end - - # Check a toggle-button (checkbox/radio). - def check locator - command 'check', locator - end - - # Uncheck a toggle-button (checkbox/radio). - def uncheck locator - command 'uncheck', locator - end - - # Select an option from a drop-down using an option locator. - # - # Option locators provide different ways of specifying options of an HTML - # Select element (e.g. for selecting a specific option, or for asserting that - # the selected option satisfies a specification). There are several forms of - # Select Option Locator. - # - # * label=labelPattern - # matches options based on their labels, i.e. the visible text. (This is the - # default.) - # label=regexp:^[Oo]ther - # * value=valuePattern - # matches options based on their values. - # value=other - # * id=id - # matches options based on their ids. - # id=option1 - # * index=index - # matches an option based on its index (offset from zero). - # index=2 - # - # If no option locator prefix is provided, the default behaviour is to match - # on label. - def select locator, option_locator - command 'select', locator, option_locator - end - - # Add a selection to the set of selected options in a multi-select element - # using an option locator. - # - # See the #select command for more information about option locators. - def add_selection locator, option_locator - command 'addSelection', locator, option_locator - end - - # Remove a selection from the set of selected options in a multi-select - # element using an option locator. - # - # See the +select+ command for more information about option locators. - def remove_selection locator, option_locator - command 'removeSelection', locator, option_locator - end - - # Submit the specified form. This is particularly useful for forms without - # submit buttons, e.g. single-input "Search" forms. - def submit locator - command 'submit', locator - end - - # Opens an URL in the test frame. This accepts both relative and absolute - # URLs. The open command waits for the page to load before - # proceeding, i.e. you don't have to call +wait_for_page_to_load+. - # - # Note: The URL must be on the same domain as the runner HTML due to security - # restrictions in the browser (Same Origin Policy). - def open url - command 'open', url_arg(url) - end - - # Selects a popup window; once a popup window has been selected, all commands - # go to that window. To select the main window again, use +nil+ as the target. - def select_window window_id - command 'selectWindow', window_id||'null' - end - - # Waits for a popup window to appear and load up. - # - # The +timeout+ is specified in milliseconds. - def wait_for_popup window_id, timeout - command 'waitForPopUp', window_id||'null', timeout - end - - # By default, Selenium's overridden window.confirm() function will return - # +true+, as if the user had manually clicked OK. After running this command, - # the next call to confirm() will return +false+, as if the user had clicked - # Cancel. - def choose_cancel_on_next_confirmation - command 'chooseCancelOnNextConfirmation' - end - - # Instructs Selenium to return the specified answer string in response to the - # next JavaScript prompt (window.prompt()). - def answer_on_next_prompt answer - command 'answerOnNextPrompt', answer - end - - # Simulates the user clicking the "back" button on their browser. - def go_back - command 'goBack' - end - - # Simulates the user clicking the "Refresh" button on their browser. - def refresh - command 'refresh' - end - - # Simulates the user clicking the "close" button in the titlebar of a popup - # window or tab. - def close - command 'close' - end - - # Writes a message to the status bar and adds a note to the browser-side log. - # - # +context+ is the message sent to the browser. - # - # +log_level_threshold+ can be +nil+, :debug, :info, - # :warn or :error. - def set_context context, log_level_threshold = nil - if log_level_threshold - command 'setContext', context, log_level_threshold.to_s - else - command 'setContext', context - end - end - - # Runs the specified JavaScript snippet repeatedly until it evaluates to - # +true+. The snippet may have multiple lines, but only the result of the last - # line will be considered. - # - # Note that, by default, the snippet will be run in the runner's test window, - # not in the window of your application. To get the window of your - # application, you can use the JavaScript snippet - # selenium.browserbot.getCurrentWindow(), and then run your - # JavaScript in there. - # - # +timeout+ is specified in milliseconds. - def wait_for_condition script, timeout - command 'waitForCondition', script, timeout - end - - # Specifies the amount of time that Selenium will wait for actions to - # complete. - # - # Actions that require waiting include +open+ and the wait_for* - # actions. - # - # The default timeout is 30 seconds. - # - # +timeout+ is specified in milliseconds. - def set_timeout timeout - command 'setTimeout', timeout - end - - # Waits for a new page to load. - # - # You can use this command instead of the +and_wait+ suffixes, - # +click_and_wait+, +select_and_wait+, +type_and_wait+ etc. (which are only - # available in the JS API). - # - # Selenium constantly keeps track of new pages loading, and sets a - # +newPageLoaded+ flag when it first notices a page load. Running any other - # Selenium command after turns the flag to +false+. Hence, if you want to wait - # for a page to load, you must wait immediately after a Selenium command that - # caused a page-load. - # - # +timeout+ is specified in milliseconds. - def wait_for_page_to_load timeout - command 'waitForPageToLoad', timeout - end - -private - # Generates the corresponding +_and_wait+ for each action. - def self.generate_and_wait_actions - public_instance_methods.each do |method| - define_method method + '_and_wait' do |*args| - make_command_waiting do - send method, *args - end - end - end - end - - generate_and_wait_actions -end - diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb b/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb deleted file mode 100644 index 0cdcb50d..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/selenium_on_rails_config.rb +++ /dev/null @@ -1,22 +0,0 @@ -require 'yaml' - -class SeleniumOnRailsConfig - @@defaults = {:environments => ['test']} - def self.get var, default = nil - value = configs[var.to_s] - value ||= @@defaults[var] - value ||= default - value ||= yield if block_given? - value - end - - private - def self.configs - unless defined? @@configs - file = File.expand_path(File.dirname(__FILE__) + '/../config.yml') - @@configs = File.exist?(file) ? YAML.load_file(file) : {} - end - @@configs - end - -end diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/views/layout.rhtml b/tracks/vendor/plugins/selenium-on-rails/lib/views/layout.rhtml deleted file mode 100644 index 16f827fd..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/views/layout.rhtml +++ /dev/null @@ -1,18 +0,0 @@ - - - - Selenium on Rails<%= defined?(@page_title) ? ": #{@page_title}" : '' %> - - - -<%= @content_for_layout %> - - \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/views/record.rhtml b/tracks/vendor/plugins/selenium-on-rails/lib/views/record.rhtml deleted file mode 100644 index 65687553..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/views/record.rhtml +++ /dev/null @@ -1,5 +0,0 @@ - -<% @result.each_pair do |key, value| -%> - -<% end -%> -
<%= key %><%= value %>
diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml b/tracks/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml deleted file mode 100644 index 4091124b..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/views/setup.rhtml +++ /dev/null @@ -1,67 +0,0 @@ -<% @page_title = 'Setup' -%> -<% if defined?(@session_wiped) or @cleared_tables.any? or @loaded_fixtures.any? -%> -
- <% if defined?(@session_wiped) -%> -

The session is wiped clean.

- <% end-%> - <% if @cleared_tables.any? -%> -

The following database tables are cleared:

-
    - <% for table in @cleared_tables -%> -
  • <%= table %>
  • - <% end-%> -
- <% end -%> - <% if @loaded_fixtures.any? -%> -

The following fixtures are loaded:

-
    - <% for fixture in @loaded_fixtures -%> -
  • <%= fixture %>
  • - <% end-%> -
- <% end -%> -
-<% end -%> - -
-

This page can be used to setup your Selenium tests. The following options can be used:

-
-
keep_session
-
- Per default the session is reset, so add keep_session in order to keep the current session. - - -
open<%= url_for %>?keep_session 
-
-
fixtures
-
- Loads one or many fixtures into the database. This will destroy the current data you have in your database! Use all as name in order to load all fixtures, or specify which fixtures that should be loaded (delimited by commas).
- If a test needs different data than you have in your fixtures, you can add another fixture set. A fixture set is just a sub directory in /test/fixtures/ where you can add alternate fixtures (e.g. /test/fixtures/blank/users.yml). - - - - -
open<%= url_for :fixtures => 'all' %> 
open<%= url_for :fixtures => 'fixture' %> 
open<%= url_for :fixtures => 'fixture_one' %>,fixture_two 
- Available fixtures
- <% fixtures = available_fixtures -%> - <% for fixture_set in fixtures.keys.sort -%> - In the <%= fixture_set.blank? ? 'default' : "#{fixture_set}" %> fixture set: -
    - <% fixtures[fixture_set].unshift fixture_set.blank? ? 'all' : "#{fixture_set}/all" -%> - <% for fixture in fixtures[fixture_set] -%> -
  • <%= fixture %>
  • - <% end -%> -
- <% end -%> -
-
clear_tables
-
- Clears one or many database tables. Another way to do the same thing is to create an empty fixture in a new fixture set (see fixtures above). - - - -
open<%= url_for :clear_tables => 'sessions' %> 
open<%= url_for :clear_tables => 'sessions' %>,outgoing_messages 
-
-
- -
diff --git a/tracks/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml b/tracks/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml deleted file mode 100644 index 5973fc97..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/lib/views/test_suite.rhtml +++ /dev/null @@ -1,26 +0,0 @@ -<% @page_title = test_suite_name @suite_path -%> - - - - - -<% for name, path in test_cases @suite_path -%> - -<% end -%> -
<%= @page_title %>
<%= link_to_test_case name, path %>
\ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/routes.rb b/tracks/vendor/plugins/selenium-on-rails/routes.rb deleted file mode 100644 index 40985dcd..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/routes.rb +++ /dev/null @@ -1,23 +0,0 @@ -module ActionController - module Routing #:nodoc: - class RouteSet #:nodoc: - alias_method :draw_without_selenium_routes, :draw - def draw - draw_without_selenium_routes do |map| - map.connect 'selenium/setup', - :controller => 'selenium', :action => 'setup' - map.connect 'selenium/tests/*testname', - :controller => 'selenium', :action => 'test_file' - map.connect 'selenium/postResults', - :controller => 'selenium', :action => 'record' - map.connect 'selenium/postResults/:logFile', - :controller => 'selenium', :action => 'record', :requirements => { :logFile => /.*/ } - map.connect 'selenium/*filename', - :controller => 'selenium', :action => 'support_file' - - yield map - end - end - end - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/switch_environment/init.rb b/tracks/vendor/plugins/selenium-on-rails/switch_environment/init.rb deleted file mode 100644 index 687cb995..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/switch_environment/init.rb +++ /dev/null @@ -1,20 +0,0 @@ -#make sure the controller is accessible -$LOAD_PATH << File.dirname(__FILE__) -require 'switch_environment_controller' - -#hijack /selenium -module ActionController - module Routing #:nodoc: - class RouteSet #:nodoc: - alias_method :draw_without_selenium_routes, :draw - def draw - draw_without_selenium_routes do |map| - map.connect 'selenium/*filename', - :controller => 'switch_environment', :action => 'index' - - yield map - end - end - end - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/switch_environment/switch_environment_controller.rb b/tracks/vendor/plugins/selenium-on-rails/switch_environment/switch_environment_controller.rb deleted file mode 100644 index 51c1ca23..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/switch_environment/switch_environment_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class SwitchEnvironmentController < ActionController::Base - def index - readme_path = File.expand_path File.join(File.dirname(__FILE__), '..', 'README') - render :status => 500, :locals => {:readme_path => readme_path }, :inline => < - Selenium on Rails is only activated for <%= SeleniumOnRailsConfig.get(:environments).join ', ' %> - environment<%= SeleniumOnRailsConfig.get(:environments).size > 1 ? 's' : '' %> (you're running - <%= RAILS_ENV %>). -

-

- Start your server in a different environment or see <%= readme_path %> - for information regarding how to change this behavior. -

-END - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake b/tracks/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake deleted file mode 100644 index a9598ca6..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/tasks/test_acceptance.rake +++ /dev/null @@ -1,8 +0,0 @@ -task :test_acceptance => 'test:acceptance' -namespace :test do - desc 'Run Selenium tests in all browsers' - task :acceptance do - require File.dirname(__FILE__) + '/../lib/selenium_on_rails/acceptance_test_runner' - SeleniumOnRails::AcceptanceTestRunner.new.run - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/test/renderer_test.rb b/tracks/vendor/plugins/selenium-on-rails/test/renderer_test.rb deleted file mode 100644 index 189094a5..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test/renderer_test.rb +++ /dev/null @@ -1,147 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class RendererTest < Test::Unit::TestCase - def setup - @controller = SeleniumController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller.layout_override =<test layout -@content_for_layout - -END - end - - def test_route - get :test_file, :testname => 'html.html' #initialize the controller - assert_equal 'http://test.host/selenium/tests/suite/test_case.sel', - @controller.url_for(:controller => 'selenium', :action => 'test_file', :testname => 'suite/test_case.sel') - end - - def test_html - get :test_file, :testname => 'html.html' - assert_headers - expected =<test layout -

Testing plain HTML

- - - -
Test HTML
open/selenium/setup 
-

and it works...

- -END - assert_text_equal expected, @response.body - end - - def test_rhtml - get :test_file, :testname => 'rhtml.rhtml' - assert_headers - expected =<test layout - - - - - - -
Rhtml
open/fi 
open/fo 
open/fum 
assertTitlePartial from RHTML 
- -END - assert_text_equal expected, @response.body - end - - def test_selenese - get :test_file, :testname => 'selenese.sel' - assert_headers - expected =<test layout -

Selenese support

- - - - - -
Selenese
open/selenium/setup 
goBack  
assertTitlePartial from Selenese 
-

works.

- - -END - assert_text_equal expected, @response.body - end - - def test_rselenese - get :test_file, :testname => 'rselenese.rsel' - assert_headers - expected = <test layout - - - - - - - - - - -
Rselenese
open/selenium/setup 
open/selenium/setup?keep_session=true 
open/selenium/setup?fixtures=all 
open/selenium/setup?fixtures=foo%2Cbar 
open/selenium/setup?fixtures=all&amp;clear_tables=foo%2Cbar 
assertAbsoluteLocationexact:http://test.host/selenium/setup 
assertTitleselenium 
assertTitlePartial from RSelenese 
- -END - assert_text_equal expected, @response.body - end - - def test_partial_support - get :test_file, :testname => 'partials/all_partials.rsel' - assert_headers - expected = <test layout - - - - - - - - - -
All partials
assertTitlePartial from All partials 
typepartialHTML partial
typeworldRHTML partial
typepartialSelenese partial
typeworldRSelenese partial
typenestingNesting partial
typedlrowRSelenese partial
- -END - assert_text_equal expected, @response.body - end - - def test_own_layout - get :test_file, :testname => 'own_layout.html' - assert_headers - expected =< - - Test case with own layout - - - - - - -
Test own layout
open/selenium/setup 
- - -END - assert_text_equal expected, @response.body - end - - def test_not_found - get :test_file, :testname => 'missing' - assert_response 404 - assert_equal 'Not found', @response.body - end - - def assert_headers - assert_response :success - assert_equal 'no-cache', @response.headers['Cache-control'] - assert_equal 'no-cache', @response.headers['Pragma'] - assert_equal '-1', @response.headers['Expires'] - end - -end diff --git a/tracks/vendor/plugins/selenium-on-rails/test/rselenese_test.rb b/tracks/vendor/plugins/selenium-on-rails/test/rselenese_test.rb deleted file mode 100644 index b85ed581..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test/rselenese_test.rb +++ /dev/null @@ -1,403 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class RSeleneseTest < Test::Unit::TestCase - include ERB::Util - - def rselenese name, input, partial = nil, type = nil - view = TestView.new - view.override_partial partial, type do - view.assigns['page_title'] = name - view.render_template 'rsel', input - end - end - - def assert_rselenese expected, name, input, partial = nil, type = nil - assert_text_equal(expected, rselenese(name, input, partial, type)) - end - - def test_empty - expected = < -Empty - -END - input = '' - assert_rselenese expected, 'Empty', input - end - - def assert_generates_command expected, name, *args - expected = expected.map {|v| h(v) } - expected << ' ' while expected.length < 3 - expected = expected.map {|v| "#{v}" }.join - expected_html = < -Selenese Commands -#{expected} - -END - args_str = args.map {|a| a.inspect }.join(',') - input = "#{name}(#{args_str})" - assert_rselenese expected_html, 'Selenese Commands', input - end - - def test_element_locators - assert_generates_command %w{click aCheckbox}, :click, 'aCheckbox' - assert_generates_command %w{click document.foo}, :click, 'document.foo' - assert_generates_command %w{click //a}, :click, '//a' - end - - def test_collection_arguments - assert_generates_command ['assertAllLinks', 'link1,link2,link3'], :assert_all_links, ['link1', 'link2','link3'] - assert_generates_command ['assertAllLinks', 'link?,link?,link?'], :assert_all_links, 'link?,link?,link?' - end - - ARG_VALUE_MAP = { - # We can't test url_for style arguments here, because we don't have - # a valid controller to interpret them. See RendererTest. - :url => '/relative/url', - :string => '1234', - :pattern => 'glob:J* Smith', # Also: many other formats. - :variable => 'varname', - :locator => 'foo', - :script => 'script', - :locator_and_attribute_name => [['foo', 'attribute'], 'foo@attribute'], - :table_locator => [['table', 2, 4], 'table.2.4'], - :coll_pattern => [[['a', "b\\", 'c,']], "a,b\\\\,c\\,"], - :event_name => 'eventName', - :keycode => 123, - :option_locator => 'label=hello', - :window_id => [[nil], 'null'], - :timeout => 123, - :log_level => :debug - } - - # Call _command_ with _args_ and make sure it produces a good table. - # If the input command doesn't 'selenize' cleanly (e.g. if the input command - # is :do_foo and the expected result is +dofoo+ and not +doFoo+) +command+ - # can be specified as an array (e.g. +[:input_command, 'expectedResult']). - def assert_command_works command, *args - expected_values = args.inject([]) do |c, arg| - v = ARG_VALUE_MAP[arg] - if v.is_a? Array - c << v[1] - else - c << v - end - end - input_values = args.inject([]) do |c, arg| - v = ARG_VALUE_MAP[arg] - if v.is_a? Array - c.concat v[0] - else - c << v - end - end - input_name, expected_name = (command.is_a?(Array) ? command : [command, SeleniumOnRails::TestBuilder.selenize(command.to_s)]) - assert_generates_command [expected_name]+expected_values, input_name.to_s, *input_values - end - - def test_action_commands - assert_command_works :click, :locator - assert_command_works :click_and_wait, :locator - assert_command_works :fire_event, :locator, :event_name - assert_command_works :fire_event_and_wait, :locator, :event_name - assert_command_works :key_press, :locator, :keycode - assert_command_works :key_press_and_wait, :locator, :keycode - assert_command_works :key_down, :locator, :keycode - assert_command_works :key_down_and_wait, :locator, :keycode - assert_command_works :key_up, :locator, :keycode - assert_command_works :key_up_and_wait, :locator, :keycode - assert_command_works :mouse_over, :locator - assert_command_works :mouse_over_and_wait, :locator - assert_command_works :mouse_down, :locator - assert_command_works :mouse_down_and_wait, :locator - assert_command_works :type, :locator, :string - assert_command_works :type_and_wait, :locator, :string - assert_command_works :check, :locator - assert_command_works :check_and_wait, :locator - assert_command_works :uncheck, :locator - assert_command_works :uncheck_and_wait, :locator - assert_command_works :select, :locator, :option_locator - assert_command_works :select_and_wait, :locator, :option_locator - assert_command_works :add_selection, :locator, :option_locator - assert_command_works :add_selection_and_wait, :locator, :option_locator - assert_command_works :remove_selection, :locator, :option_locator - assert_command_works :remove_selection_and_wait, :locator, :option_locator - assert_command_works :submit, :locator - assert_command_works :open, :url - assert_command_works :select_window, :window_id - assert_command_works [:wait_for_popup, 'waitForPopUp'], :window_id, :timeout - assert_command_works :choose_cancel_on_next_confirmation - assert_command_works :choose_cancel_on_next_confirmation_and_wait - assert_command_works :answer_on_next_prompt, :string - assert_command_works :answer_on_next_prompt_and_wait, :string - assert_command_works :go_back - assert_command_works :refresh - assert_command_works :close - assert_command_works :set_context, :string - assert_command_works :set_context, :string, :log_level - assert_command_works :wait_for_condition, :script, :timeout - assert_command_works :set_timeout, :timeout - assert_command_works :wait_for_page_to_load, :timeout - end - - def test_accessor_commands - assert_command_works :store_alert_present, :variable - assert_command_works :assert_alert_present - assert_command_works :assert_alert_not_present - assert_command_works :verify_alert_present - assert_command_works :verify_alert_not_present - assert_command_works :wait_for_alert_present - assert_command_works :wait_for_alert_not_present - - assert_command_works :store_prompt_present, :variable - assert_command_works :assert_prompt_present - assert_command_works :assert_prompt_not_present - assert_command_works :verify_prompt_present - assert_command_works :verify_prompt_not_present - assert_command_works :wait_for_prompt_present - assert_command_works :wait_for_prompt_not_present - - assert_command_works :store_confirmation_present, :variable - assert_command_works :assert_confirmation_present - assert_command_works :assert_confirmation_not_present - assert_command_works :verify_confirmation_present - assert_command_works :verify_confirmation_not_present - assert_command_works :wait_for_confirmation_present - assert_command_works :wait_for_confirmation_not_present - - assert_command_works :store_alert, :variable - assert_command_works :assert_alert, :pattern - assert_command_works :assert_not_alert, :pattern - assert_command_works :verify_alert, :pattern - assert_command_works :verify_not_alert, :pattern - assert_command_works :wait_for_alert, :pattern - assert_command_works :wait_for_not_alert, :pattern - - assert_command_works :store_confirmation, :variable - assert_command_works :assert_confirmation, :pattern - assert_command_works :assert_not_confirmation, :pattern - assert_command_works :verify_confirmation, :pattern - assert_command_works :verify_not_confirmation, :pattern - assert_command_works :wait_for_confirmation, :pattern - assert_command_works :wait_for_not_confirmation, :pattern - - assert_command_works :store_prompt, :variable - assert_command_works :assert_prompt, :pattern - assert_command_works :assert_not_prompt, :pattern - assert_command_works :verify_prompt, :pattern - assert_command_works :verify_not_prompt, :pattern - assert_command_works :wait_for_prompt, :pattern - assert_command_works :wait_for_not_prompt, :pattern - - assert_command_works :store_absolute_location, :variable - assert_command_works :assert_absolute_location, :url - assert_command_works :assert_not_absolute_location, :url - assert_command_works :verify_absolute_location, :url - assert_command_works :verify_not_absolute_location, :url - assert_command_works :wait_for_absolute_location, :url - assert_command_works :wait_for_not_absolute_location, :url - - assert_command_works :store_location, :pattern, :variable - assert_command_works :assert_location, :url - assert_command_works :assert_not_location, :url - assert_command_works :verify_location, :url - assert_command_works :verify_not_location, :url - assert_command_works :wait_for_location, :url - assert_command_works :wait_for_not_location, :url - - assert_command_works :store_title, :variable - assert_command_works :assert_title, :pattern - assert_command_works :assert_not_title, :pattern - assert_command_works :verify_title, :pattern - assert_command_works :verify_not_title, :pattern - assert_command_works :wait_for_title, :pattern - assert_command_works :wait_for_not_title, :pattern - - assert_command_works :store_body_text, :variable - assert_command_works :assert_body_text, :pattern - assert_command_works :assert_not_body_text, :pattern - assert_command_works :verify_body_text, :pattern - assert_command_works :verify_not_body_text, :pattern - assert_command_works :wait_for_body_text, :pattern - assert_command_works :wait_for_not_body_text, :pattern - - assert_command_works :store_value, :locator, :variable - assert_command_works :assert_value, :locator, :pattern - assert_command_works :assert_not_value, :locator, :pattern - assert_command_works :verify_value, :locator, :pattern - assert_command_works :verify_not_value, :locator, :pattern - assert_command_works :wait_for_value, :locator, :pattern - assert_command_works :wait_for_not_value, :locator, :pattern - - assert_command_works :store_text, :locator, :variable - assert_command_works :assert_text, :locator, :pattern - assert_command_works :assert_not_text, :locator, :pattern - assert_command_works :verify_text, :locator, :pattern - assert_command_works :verify_not_text, :locator, :pattern - assert_command_works :wait_for_text, :locator, :pattern - assert_command_works :wait_for_not_text, :locator, :pattern - - assert_command_works :store_eval, :script, :variable - assert_command_works :assert_eval, :script, :pattern - assert_command_works :assert_not_eval, :script, :pattern - assert_command_works :verify_eval, :script, :pattern - assert_command_works :verify_not_eval, :script, :pattern - assert_command_works :wait_for_eval, :script, :pattern - assert_command_works :wait_for_not_eval, :script, :pattern - - assert_command_works :store_checked, :locator, :variable - assert_command_works :assert_checked, :locator, :pattern - assert_command_works :assert_not_checked, :locator, :pattern - assert_command_works :verify_checked, :locator, :pattern - assert_command_works :verify_not_checked, :locator, :pattern - assert_command_works :wait_for_checked, :locator, :pattern - assert_command_works :wait_for_not_checked, :locator, :pattern - - assert_command_works :store_table, :table_locator, :variable - assert_command_works :assert_table, :table_locator, :pattern - assert_command_works :assert_not_table, :table_locator, :pattern - assert_command_works :verify_table, :table_locator, :pattern - assert_command_works :verify_not_table, :table_locator, :pattern - assert_command_works :wait_for_table, :table_locator, :pattern - assert_command_works :wait_for_not_table, :table_locator, :pattern - - assert_raise RuntimeError do - assert_command_works :store_selected, :locator, :option_locator, :variable - end - assert_command_works :assert_selected, :locator, :option_locator - assert_command_works :assert_not_selected, :locator, :option_locator - assert_command_works :verify_selected, :locator, :option_locator - assert_command_works :verify_not_selected, :locator, :option_locator - assert_command_works :wait_for_selected, :locator, :option_locator - assert_command_works :wait_for_not_selected, :locator, :option_locator - - assert_command_works :store_selected_options, :locator, :variable - assert_command_works :assert_selected_options, :locator, :coll_pattern - assert_command_works :assert_not_selected_options, :locator, :coll_pattern - assert_command_works :verify_selected_options, :locator, :coll_pattern - assert_command_works :verify_not_selected_options, :locator, :coll_pattern - assert_command_works :wait_for_selected_options, :locator, :coll_pattern - assert_command_works :wait_for_not_selected_options, :locator, :coll_pattern - - assert_command_works :store_select_options, :locator, :variable - assert_command_works :assert_select_options, :locator, :coll_pattern - assert_command_works :assert_not_select_options, :locator, :coll_pattern - assert_command_works :verify_select_options, :locator, :coll_pattern - assert_command_works :verify_not_select_options, :locator, :coll_pattern - assert_command_works :wait_for_select_options, :locator, :coll_pattern - assert_command_works :wait_for_not_select_options, :locator, :coll_pattern - - assert_command_works :store_attribute, :locator_and_attribute_name, :variable - assert_command_works :assert_attribute, :locator_and_attribute_name, :pattern - assert_command_works :assert_not_attribute, :locator_and_attribute_name, :pattern - assert_command_works :verify_attribute, :locator_and_attribute_name, :pattern - assert_command_works :verify_not_attribute, :locator_and_attribute_name, :pattern - assert_command_works :wait_for_attribute, :locator_and_attribute_name, :pattern - assert_command_works :wait_for_not_attribute, :locator_and_attribute_name, :pattern - - assert_command_works :store_text_present, :pattern, :variable - assert_command_works :assert_text_present, :pattern - assert_command_works :assert_text_not_present, :pattern - assert_command_works :verify_text_present, :pattern - assert_command_works :verify_text_not_present, :pattern - assert_command_works :wait_for_text_present, :pattern - assert_command_works :wait_for_text_not_present, :pattern - - assert_command_works :store_element_present, :locator, :variable - assert_command_works :assert_element_present, :locator - assert_command_works :assert_element_not_present, :locator - assert_command_works :verify_element_present, :locator - assert_command_works :verify_element_not_present, :locator - assert_command_works :wait_for_element_present, :locator - assert_command_works :wait_for_element_not_present, :locator - - assert_command_works :store_visible, :locator, :variable - assert_command_works :assert_visible, :locator - assert_command_works :assert_not_visible, :locator - assert_command_works :verify_visible, :locator - assert_command_works :verify_not_visible, :locator - assert_command_works :wait_for_visible, :locator - assert_command_works :wait_for_not_visible, :locator - - assert_command_works :store_editable, :locator, :variable - assert_command_works :assert_editable, :locator - assert_command_works :assert_not_editable, :locator - assert_command_works :verify_editable, :locator - assert_command_works :verify_not_editable, :locator - assert_command_works :wait_for_editable, :locator - assert_command_works :wait_for_not_editable, :locator - - assert_command_works :store_all_buttons, :variable - assert_command_works :assert_all_buttons, :coll_pattern - assert_command_works :assert_not_all_buttons, :coll_pattern - assert_command_works :verify_all_buttons, :coll_pattern - assert_command_works :verify_not_all_buttons, :coll_pattern - assert_command_works :wait_for_all_buttons, :coll_pattern - assert_command_works :wait_for_not_all_buttons, :coll_pattern - - assert_command_works :store_all_links, :variable - assert_command_works :assert_all_links, :coll_pattern - assert_command_works :assert_not_all_links, :coll_pattern - assert_command_works :verify_all_links, :coll_pattern - assert_command_works :verify_not_all_links, :coll_pattern - assert_command_works :wait_for_all_links, :coll_pattern - assert_command_works :wait_for_not_all_links, :coll_pattern - - assert_command_works :store_all_fields, :variable - assert_command_works :assert_all_fields, :coll_pattern - assert_command_works :assert_not_all_fields, :coll_pattern - assert_command_works :verify_all_fields, :coll_pattern - assert_command_works :verify_not_all_fields, :coll_pattern - assert_command_works :wait_for_all_fields, :coll_pattern - assert_command_works :wait_for_not_all_fields, :coll_pattern - - assert_command_works :store_html_source, :variable - assert_command_works :assert_html_source, :pattern - assert_command_works :assert_not_html_source, :pattern - assert_command_works :verify_html_source, :pattern - assert_command_works :verify_not_html_source, :pattern - assert_command_works :wait_for_html_source, :pattern - assert_command_works :wait_for_not_html_source, :pattern - - assert_command_works :store_expression, :script, :variable - assert_command_works :assert_expression, :script, :pattern - assert_command_works :assert_not_expression, :script, :pattern - assert_command_works :verify_expression, :script, :pattern - assert_command_works :verify_not_expression, :script, :pattern - assert_command_works :wait_for_expression, :script, :pattern - assert_command_works :wait_for_not_expression, :script, :pattern - end - - def test_partial_support - expected = < -Partial support -typepartialRSelenese partial - -END - input = "include_partial 'override'" - partial = "type 'partial', 'RSelenese partial'" - assert_rselenese expected, 'Partial support', input, partial, 'rsel' - end - - def test_partial_support_with_local_assigns - expected = < -Partial support with local variables -typepartialRSelenese partial -typelocalpar -typelocaltial - -END_EXPECTED - input = "include_partial 'override', :locator => 'local', :input => ['par', 'tial']" - partial = < -Empty - -END - input = '' - assert_selenese expected, 'Empty', '' - end - - def test_one_line - expected = < -One line -open/  - -END - input = '|open|/|' - assert_selenese expected, 'One line', input - end - - def test_comments_only - expected = <Comment 1

- - -

Comment 2

- - -
Only comments
-END - input = < -Only commands -goBack   -open/foo  -fireEventtextFieldfocus - -END - input = < -Commands and comments -goBack   -fireEventtextFieldfocus - -

Comment 1

- - -

Comment 2

-END - input = <Comment 1

- - -

Comment 2

- - - - -
Comments and commands
goBack  
fireEventtextFieldfocus
-END - input = <Comment 1

- - -

Comment 2

- - - - -
Comments, commands and comments
goBack  
fireEventtextFieldfocus
-

Comment 3

-END - input = < -HTML escaping -typenameField<>& - -END - input = '|type|nameField|<>&|' - assert_selenese expected, 'HTML escaping', input - end - - def test_partial_support - expected = < -Partial support -typepartialSelenese partial - -END - input = '|includePartial|override|' - partial = '|type|partial|Selenese partial|' - assert_selenese expected, 'Partial support', input, partial, 'sel' - end - - def test_partial_support_with_local_assigns - expected = < -Partial support with local assigns -typeassignsa=hello,b=world!,c_123ABC= -typeassignsa=a b c d,b=,c_123ABC=hello - -END_EXPECTED - input = <whatever -typeassigns -a=<%= a if defined? a%>, -b=<%= b if defined? b%>, -c_123ABC=<%= c_123ABC if defined? c_123ABC%> - - -END_PARTIAL - assert_selenese expected, 'Partial support with local assigns', input, partial, 'rhtml' - end - - def test_raised_when_more_than_three_columns - assert_raise RuntimeError, 'There might only be a maximum of three cells!' do - selenese 'name', '|col1|col2|col3|col4|' - end - end - - def test_raised_when_more_than_one_set_of_commands - assert_raise RuntimeError, 'You cannot have comments in the middle of commands!' do - input = < - - - - -
Foo
Bar
-EOS - post :record, :suite => suite, - "testTable.1" => "
", - "testTable.2" => "
" - cur_result_dir = File.join(@result_dir, "default") - assert File.directory?(cur_result_dir) - assert_equal ["blank.html", "index.html", "suite.html", "test1.html", "test2.html"], - Dir.glob("#{cur_result_dir}/*.html").map{|path| File.basename(path)}.sort - expected = < - - - - - - - -
Foo
Bar
- -EOS - assert_equal expected, File.read("#{cur_result_dir}/suite.html") - end -end diff --git a/tracks/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb b/tracks/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb deleted file mode 100644 index 6502461a..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test/selenium_support_test.rb +++ /dev/null @@ -1,33 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class SeleniumSupportTest < Test::Unit::TestCase - def setup - @controller = SeleniumController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - end - - def test_route - get :support_file, :filename => 'TestRunner.html' #initialize the controller - assert_equal 'http://test.host/selenium/TestRunner.html', - @controller.url_for(:controller => 'selenium', :action => 'support_file', :filename => 'TestRunner.html') - end - - def test_test_runner_existance - get :support_file, :filename => 'TestRunner.html' - assert_response :success - assert @response.body.include?('Selenium') - end - - def test_default_file - get :support_file, :filename => '' - assert_redirected_to :filename => 'TestRunner.html', :test => 'tests' - end - - def test_missing_file - get :support_file, :filename => 'missing.html' - assert_response 404 - assert_equal 'Not found', @response.body - end - -end diff --git a/tracks/vendor/plugins/selenium-on-rails/test/setup_test.rb b/tracks/vendor/plugins/selenium-on-rails/test/setup_test.rb deleted file mode 100644 index ad2e4c3c..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test/setup_test.rb +++ /dev/null @@ -1,29 +0,0 @@ -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 diff --git a/tracks/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb b/tracks/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb deleted file mode 100644 index 07fe568f..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test/suite_renderer_test.rb +++ /dev/null @@ -1,173 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class SuiteRendererTest < Test::Unit::TestCase - def setup - @controller = SeleniumController.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - @controller.layout_override =<test layout -@content_for_layout - -END - end - - def test_empty_suite - get :test_file, :testname => 'empty_suite' - assert_response :success - expected =<test layout - - - - - -
Empty suite
- -END - assert_text_equal expected, @response.body - end - - - def test_root_suite - _test_root_suite '' - end - - def test_test_suite_html - #TestSuite.html is the default name the Selenium Runner tries to run - _test_root_suite 'TestSuite.html' - end - - def _test_root_suite testname - get :test_file, :testname => testname - assert_response :success - expected =<test layout - - - - - - - - - - - - - - - -
All test cases
Html
Own layout
Rhtml
Rselenese
Selenese
Partials.All partials
Suite one.Suite one testcase1
Suite one.Suite one testcase2
Suite one.Subsuite.Suite one subsuite testcase
Suite two.Suite two testcase
- -END - assert_text_equal expected, @response.body - end - - def test_suite_one - get :test_file, :testname => 'suite_one' - assert_response :success - expected =<test layout - - - - - - - - -
Suite one
Suite one testcase1
Suite one testcase2
Subsuite.Suite one subsuite testcase
- -END - assert_text_equal expected, @response.body - end - - def test_sub_suite - get :test_file, :testname => 'suite_one/subsuite' - assert_response :success - expected =<test layout - - - - - - -
Subsuite
Suite one subsuite testcase
- -END - assert_text_equal expected, @response.body - end - - def test_missing_tests_directory - def @controller.selenium_tests_path - File.join(File.dirname(__FILE__), 'invalid') - end - get :test_file, :testname => '' - assert_response 404 - assert_equal "Did not find the Selenium tests path (#{File.join(File.dirname(__FILE__), 'invalid')}). Run script/generate selenium", @response.body - end - -end diff --git a/tracks/vendor/plugins/selenium-on-rails/test/test_helper.rb b/tracks/vendor/plugins/selenium-on-rails/test/test_helper.rb deleted file mode 100644 index 7c8e4705..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test/test_helper.rb +++ /dev/null @@ -1,70 +0,0 @@ -ENV["RAILS_ENV"] = "test" -require File.expand_path(File.dirname(__FILE__) + "/../../../../config/environment") -require 'test_help' -require 'controllers/selenium_controller' - -module SeleniumOnRails::Paths - def selenium_tests_path - File.expand_path(File.dirname(__FILE__) + '/../test_data') - end -end - -class SeleniumController - attr_accessor :layout_override - # Re-raise errors caught by the controller. - def rescue_action e - raise e - end - - def render options = nil, deprecated_status = nil - if override_layout? options - options[:layout] = false - super options, deprecated_status - return response.body = @layout_override.gsub('@content_for_layout', response.body) - end - super options, deprecated_status - end - - private - def override_layout? options - return false unless @layout_override - if options[:action] or options[:template] - options[:layout] != false #for action and template the default layout is used if not explicitly disabled - else - not [nil, false].include? options[:layout] #otherwise a layout has to be specified - end - end - -end - -class Test::Unit::TestCase - def assert_text_equal expected, actual - assert_equal clean_text(expected), clean_text(actual) - end - - def clean_text text - text.gsub("\t", ' ').gsub("\r", '').gsub("\n", '').gsub(/ * @override, :type => @override_type, :locals => local_assigns - extract_commands_from_partial partial - else - render_partial_without_override partial_path, object, local_assigns, status - end - end - - def override_partial partial, type - @override, @override_type = partial, type - result = yield - @override, @override_type = nil, nil - result - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/_partial.rsel b/tracks/vendor/plugins/selenium-on-rails/test_data/_partial.rsel deleted file mode 100644 index d6c575a7..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/_partial.rsel +++ /dev/null @@ -1 +0,0 @@ -assert_title "Partial from #{source}" \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/html.html b/tracks/vendor/plugins/selenium-on-rails/test_data/html.html deleted file mode 100644 index 1a0addb8..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/html.html +++ /dev/null @@ -1,6 +0,0 @@ -

Testing plain HTML

- - - -
Test HTML
open/selenium/setup 
-

and it works...

\ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/own_layout.html b/tracks/vendor/plugins/selenium-on-rails/test_data/own_layout.html deleted file mode 100644 index a45c5498..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/own_layout.html +++ /dev/null @@ -1,12 +0,0 @@ - - - Test case with own layout - - - - - - -
Test own layout
open/selenium/setup 
- - diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_html.html b/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_html.html deleted file mode 100644 index 916ca4f7..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_html.html +++ /dev/null @@ -1,6 +0,0 @@ -

This should never be visible!

- - - -
HTML partial
typepartialHTML partial
-

Neither should this!

\ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel b/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel deleted file mode 100644 index 28e7bf91..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_nesting.rsel +++ /dev/null @@ -1,2 +0,0 @@ -type 'nesting', 'Nesting partial' -include_partial 'partials/rsel', :hello => hello.reverse \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml b/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml deleted file mode 100644 index af6599de..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_rhtml.rhtml +++ /dev/null @@ -1,6 +0,0 @@ -

This should never be visible!

- - - -
RHTML partial
type<%= hello %>RHTML partial
-

Neither should this!

\ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel b/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel deleted file mode 100644 index 0ce0e9fe..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_rsel.rsel +++ /dev/null @@ -1 +0,0 @@ -type hello, 'RSelenese partial' diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel b/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel deleted file mode 100644 index 353f0f26..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/_sel.sel +++ /dev/null @@ -1,5 +0,0 @@ -h1. This should not be visible! - -|type|partial|Selenese partial| - -p. Neither should this! \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel b/tracks/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel deleted file mode 100644 index 08c0faf5..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/partials/all_partials.rsel +++ /dev/null @@ -1,5 +0,0 @@ -include_partial 'partial', :source => title -['html', 'rhtml', 'sel', 'rsel'].each do |format| - include_partial "partials/#{format}", :hello => 'world' -end -include_partial 'partials/nesting', :hello => 'world' \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml b/tracks/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml deleted file mode 100644 index 2ae4e413..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/rhtml.rhtml +++ /dev/null @@ -1,7 +0,0 @@ - - -<% for page in ['/fi', '/fo', '/fum'] -%> - -<% end -%> - <%= render :partial => 'partial', :locals => {:source => 'RHTML'} %> -
<%= @page_title %>
open<%= page %> 
\ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel b/tracks/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel deleted file mode 100644 index 0c8e9d59..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/rselenese.rsel +++ /dev/null @@ -1,8 +0,0 @@ -setup -setup :keep_session -test.setup :fixtures => :all -setup :fixtures => [:foo, 'bar'] -setup :clear_tables => [:foo, :bar], :fixtures => :all -assert_absolute_location :controller => 'selenium', :action => 'setup' #urls must be tested with a controller -assert_title view.controller.controller_name #make sure we can access the view easily -include_partial 'partial', :source => 'RSelenese' diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/selenese.sel b/tracks/vendor/plugins/selenium-on-rails/test_data/selenese.sel deleted file mode 100644 index 46b1dce9..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/selenese.sel +++ /dev/null @@ -1,7 +0,0 @@ -Selenese *support* - -|open|/selenium/setup| -|goBack| -|includePartial|partial|source=Selenese| - -works. \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/subsuite/suite_one_subsuite_testcase.sel b/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/subsuite/suite_one_subsuite_testcase.sel deleted file mode 100644 index 9c3209b6..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/subsuite/suite_one_subsuite_testcase.sel +++ /dev/null @@ -1 +0,0 @@ -|open|/| \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase1.sel b/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase1.sel deleted file mode 100644 index 9c3209b6..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase1.sel +++ /dev/null @@ -1 +0,0 @@ -|open|/| \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase2.sel b/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase2.sel deleted file mode 100644 index 9c3209b6..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/suite_one/suite_one_testcase2.sel +++ /dev/null @@ -1 +0,0 @@ -|open|/| \ No newline at end of file diff --git a/tracks/vendor/plugins/selenium-on-rails/test_data/suite_two/suite_two_testcase.sel b/tracks/vendor/plugins/selenium-on-rails/test_data/suite_two/suite_two_testcase.sel deleted file mode 100644 index 9c3209b6..00000000 --- a/tracks/vendor/plugins/selenium-on-rails/test_data/suite_two/suite_two_testcase.sel +++ /dev/null @@ -1 +0,0 @@ -|open|/| \ No newline at end of file diff --git a/tracks/vendor/plugins/simple_ldap_authenticator/README b/tracks/vendor/plugins/simple_ldap_authenticator/README deleted file mode 100644 index dc8ca509..00000000 --- a/tracks/vendor/plugins/simple_ldap_authenticator/README +++ /dev/null @@ -1,5 +0,0 @@ -SimpleLdapAuthenticator -======================= - -Allows for simple authentication to an LDAP server with a minimum of -configuration. See the RDoc for details. diff --git a/tracks/vendor/plugins/simple_ldap_authenticator/Rakefile b/tracks/vendor/plugins/simple_ldap_authenticator/Rakefile deleted file mode 100644 index f7c3459e..00000000 --- a/tracks/vendor/plugins/simple_ldap_authenticator/Rakefile +++ /dev/null @@ -1,22 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the simple_ldap_authenticator plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the simple_ldap_authenticator plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'SimpleLdapAuthenticator' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/tracks/vendor/plugins/simple_ldap_authenticator/init.rb b/tracks/vendor/plugins/simple_ldap_authenticator/init.rb deleted file mode 100644 index 85917669..00000000 --- a/tracks/vendor/plugins/simple_ldap_authenticator/init.rb +++ /dev/null @@ -1,2 +0,0 @@ -# Include hook code here -#require 'simple_ldap_authenticator' diff --git a/tracks/vendor/plugins/simple_ldap_authenticator/install.rb b/tracks/vendor/plugins/simple_ldap_authenticator/install.rb deleted file mode 100644 index f7732d37..00000000 --- a/tracks/vendor/plugins/simple_ldap_authenticator/install.rb +++ /dev/null @@ -1 +0,0 @@ -# Install hook code here diff --git a/tracks/vendor/plugins/simple_ldap_authenticator/lib/simple_ldap_authenticator.rb b/tracks/vendor/plugins/simple_ldap_authenticator/lib/simple_ldap_authenticator.rb deleted file mode 100644 index 2992d892..00000000 --- a/tracks/vendor/plugins/simple_ldap_authenticator/lib/simple_ldap_authenticator.rb +++ /dev/null @@ -1,127 +0,0 @@ -# SimpleLdapAuthenticator -# -# This plugin supports both Ruby/LDAP and Net::LDAP, defaulting to Ruby/LDAP -# if it is available. If both are installed and you want to force the use of -# Net::LDAP, set SimpleLdapAuthenticator.ldap_library = 'net/ldap'. - -# Allows for easily authenticating users via LDAP (or LDAPS). If authenticating -# via LDAP to a server running on localhost, you should only have to configure -# the login_format. -# -# Can be configured using the following accessors (with examples): -# * login_format = '%s@domain.com' # Active Directory, OR -# * login_format = 'cn=%s,cn=users,o=organization,c=us' # Other LDAP servers -# * servers = ['dc1.domain.com', 'dc2.domain.com'] # names/addresses of LDAP servers to use -# * use_ssl = true # for logging in via LDAPS -# * port = 3289 # instead of 389 for LDAP or 636 for LDAPS -# * logger = RAILS_DEFAULT_LOGGER # for logging authentication successes/failures -# -# The class is used as a global variable, you are not supposed to create an -# instance of it. For example: -# -# require 'simple_ldap_authenticator' -# SimpleLdapAuthenticator.servers = %w'dc1.domain.com dc2.domain.com' -# SimpleLdapAuthenticator.use_ssl = true -# SimpleLdapAuthenticator.login_format = '%s@domain.com' -# SimpleLdapAuthenticator.logger = RAILS_DEFAULT_LOGGER -# class LoginController < ApplicationController -# def login -# return redirect_to(:action=>'try_again') unless SimpleLdapAuthenticator.valid?(params[:username], params[:password]) -# session[:username] = params[:username] -# end -# end -class SimpleLdapAuthenticator - class << self - @servers = ['127.0.0.1'] - @use_ssl = false - @login_format = '%s' - attr_accessor :servers, :use_ssl, :port, :login_format, :logger, :connection, :ldap_library - - # Load the required LDAP library, either 'ldap' or 'net/ldap' - def load_ldap_library - return if @ldap_library_loaded - if ldap_library - if ldap_library == 'net/ldap' - require 'net/ldap' - else - require 'ldap' - require 'ldap/control' - end - else - begin - require 'ldap' - require 'ldap/control' - ldap_library = 'ldap' - rescue LoadError - require 'net/ldap' - ldap_library = 'net/ldap' - end - end - @ldap_library_loaded = true - end - - # The next LDAP server to which to connect - def server - servers[0] - end - - # The connection to the LDAP server. A single connection is made and the - # connection is only changed if a server returns an error other than - # invalid password. - def connection - return @connection if @connection - load_ldap_library - @connection = if ldap_library == 'net/ldap' - Net::LDAP.new(:host=>server, :port=>(port), :encryption=>(:simple_tls if use_ssl)) - else - (use_ssl ? LDAP::SSLConn : LDAP::Conn).new(server, port) - end - end - - # The port to use. Defaults to 389 for LDAP and 636 for LDAPS. - def port - @port ||= use_ssl ? 636 : 389 - end - - # Disconnect from current LDAP server and use a different LDAP server on the - # next authentication attempt - def switch_server - self.connection = nil - servers << servers.shift - end - - # Check the validity of a login/password combination - def valid?(login, password) - if ldap_library == 'net/ldap' - connection.authenticate(login_format % login.to_s, password.to_s) - begin - if connection.bind - logger.info("Authenticated #{login.to_s} by #{server}") if logger - true - else - logger.info("Error attempting to authenticate #{login.to_s} by #{server}: #{connection.get_operation_result.code} #{connection.get_operation_result.message}") if logger - switch_server unless connection.get_operation_result.code == 49 - false - end - rescue Net::LDAP::LdapError => error - logger.info("Error attempting to authenticate #{login.to_s} by #{server}: #{error.message}") if logger - switch_server - false - end - else - connection.unbind if connection.bound? - begin - connection.bind(login_format % login.to_s, password.to_s) - connection.unbind - logger.info("Authenticated #{login.to_s} by #{server}") if logger - true - rescue LDAP::ResultError => error - connection.unbind if connection.bound? - logger.info("Error attempting to authenticate #{login.to_s} by #{server}: #{error.message}") if logger - switch_server unless error.message == 'Invalid credentials' - false - end - end - end - end -end diff --git a/tracks/vendor/plugins/simple_ldap_authenticator/tasks/simple_ldap_authenticator_tasks.rake b/tracks/vendor/plugins/simple_ldap_authenticator/tasks/simple_ldap_authenticator_tasks.rake deleted file mode 100644 index 1916c233..00000000 --- a/tracks/vendor/plugins/simple_ldap_authenticator/tasks/simple_ldap_authenticator_tasks.rake +++ /dev/null @@ -1,4 +0,0 @@ -# desc "Explaining what the task does" -# task :simple_ldap_authenticator do -# # Task goes here -# end \ No newline at end of file diff --git a/tracks/vendor/plugins/simple_ldap_authenticator/test/simple_ldap_authenticator_test.rb b/tracks/vendor/plugins/simple_ldap_authenticator/test/simple_ldap_authenticator_test.rb deleted file mode 100644 index dfd92dae..00000000 --- a/tracks/vendor/plugins/simple_ldap_authenticator/test/simple_ldap_authenticator_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'test/unit' - -class SimpleLdapAuthenticatorTest < Test::Unit::TestCase - # Replace this with your real tests. - def test_this_plugin - flunk - end -end diff --git a/tracks/vendor/plugins/simply_helpful/README b/tracks/vendor/plugins/simply_helpful/README deleted file mode 100644 index 4711fe24..00000000 --- a/tracks/vendor/plugins/simply_helpful/README +++ /dev/null @@ -1,4 +0,0 @@ -SimplyHelpful -============= - -Description goes here \ No newline at end of file diff --git a/tracks/vendor/plugins/simply_helpful/Rakefile b/tracks/vendor/plugins/simply_helpful/Rakefile deleted file mode 100644 index efce24d2..00000000 --- a/tracks/vendor/plugins/simply_helpful/Rakefile +++ /dev/null @@ -1,22 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the simply_helpful plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the simply_helpful plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'SimplyHelpful' - rdoc.options << '--line-numbers' << '--inline-source' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end diff --git a/tracks/vendor/plugins/simply_helpful/init.rb b/tracks/vendor/plugins/simply_helpful/init.rb deleted file mode 100644 index d80efa41..00000000 --- a/tracks/vendor/plugins/simply_helpful/init.rb +++ /dev/null @@ -1,4 +0,0 @@ -require 'simply_helpful' -ActionController::Base.send :include, SimplyHelpful::RecordIdentificationHelper -ActionController::Base.helper SimplyHelpful::RecordIdentificationHelper, - SimplyHelpful::RecordTagHelper diff --git a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful.rb b/tracks/vendor/plugins/simply_helpful/lib/simply_helpful.rb deleted file mode 100644 index 5eb54b59..00000000 --- a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'simply_helpful/record_identification_helper' -require 'simply_helpful/record_identifier' -require 'simply_helpful/record_tag_helper' - -require 'simply_helpful/jsg_extensions' -require 'simply_helpful/av_extensions' -require 'simply_helpful/form_helper_extensions' -require 'simply_helpful/controller_extensions' \ No newline at end of file diff --git a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/av_extensions.rb b/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/av_extensions.rb deleted file mode 100644 index d4cd4f97..00000000 --- a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/av_extensions.rb +++ /dev/null @@ -1,26 +0,0 @@ -module ActionView - module Partials - def render_partial_with_record_identification(partial_path, local_assigns = nil, deprecated_local_assigns = nil) - if partial_path.is_a?(String) || partial_path.is_a?(Symbol) || partial_path.nil? - render_partial_without_record_identification( - partial_path, local_assigns, deprecated_local_assigns - ) - elsif partial_path.is_a?(Array) - if partial_path.any? - path = SimplyHelpful::RecordIdentifier.partial_path(partial_path.first) - collection = partial_path - render_partial_collection( - path, collection, nil, local_assigns.value - ) - else - "" - end - else - render_partial_without_record_identification( - SimplyHelpful::RecordIdentifier.partial_path(partial_path), local_assigns, deprecated_local_assigns - ) - end - end - alias_method_chain :render_partial, :record_identification - end -end diff --git a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/controller_extensions.rb b/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/controller_extensions.rb deleted file mode 100644 index 1b589c85..00000000 --- a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/controller_extensions.rb +++ /dev/null @@ -1,35 +0,0 @@ -module SimplyHelpful - module ActionControllerExtensions - def self.included(base) - base.helper_method :polymorphic_url - base.helper_method :polymorphic_path - end - - def polymorphic_url(record) - SimplyHelpful::RecordIdentifier.polymorphic_url(record, self) - end - - def polymorphic_path(record) - SimplyHelpful::RecordIdentifier.polymorphic_path(record, self) - end - - def redirect_to_with_record_identification(*args) - return redirect_to_without_record_identification *args unless args.size == 1 - - potential_object = args.first - - case potential_object - when String, Symbol, Hash - redirect_to_without_record_identification *args - else - redirect_to_without_record_identification SimplyHelpful::RecordIdentifier.polymorphic_url(potential_object, self) - end - end - end -end -module ActionController - class Base - include SimplyHelpful::ActionControllerExtensions - alias_method_chain :redirect_to, :record_identification - end -end diff --git a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/form_helper_extensions.rb b/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/form_helper_extensions.rb deleted file mode 100644 index ca8b77fa..00000000 --- a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/form_helper_extensions.rb +++ /dev/null @@ -1,48 +0,0 @@ -module ActionView - module Helpers - module FormHelper - def form_for_with_record_identification(name_or_object, *args, &proc) - form_method_with_record_identification :form_for, name_or_object, *args, &proc - end - - alias_method_chain :form_for, :record_identification - - protected - def form_method_with_record_identification(method_name, name_or_object, *args, &proc) - old_method_name = "#{method_name}_without_record_identification" - case name_or_object - when String, Symbol, NilClass - send(old_method_name, name_or_object, *args, &proc) - else - options = args.first || {} - - object_name = SimplyHelpful::RecordIdentifier.singular_class_name(name_or_object) - object = name_or_object - url = SimplyHelpful::RecordIdentifier.polymorphic_url(object, self) - - html_options = if object.new_record? - { :class => dom_class(object, :new), :id => dom_id(object), :method => :post } - else - { :class => dom_class(object, :edit), :id => dom_id(object, :edit), :method => :put } - end - - send(old_method_name, - object_name, object, options.merge({ :url => url, :html => html_options.update(options[:html] || {}) }), &proc - ) - end - end - end - end -end - -module ActionView - module Helpers - module PrototypeHelper - def remote_form_for_with_record_identification(name_or_object, *args, &proc) - form_method_with_record_identification :remote_form_for, name_or_object, *args, &proc - end - - alias_method_chain :remote_form_for, :record_identification - end - end -end diff --git a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/jsg_extensions.rb b/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/jsg_extensions.rb deleted file mode 100644 index 6c9842a9..00000000 --- a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/jsg_extensions.rb +++ /dev/null @@ -1,18 +0,0 @@ -module ActionView - module Helpers - module PrototypeHelper - class JavaScriptGenerator - module GeneratorMethods - def [](id) - case id - when String, Symbol, NilClass - JavaScriptElementProxy.new(self, id) - else - JavaScriptElementProxy.new(self, SimplyHelpful::RecordIdentifier.dom_id(id)) - end - end - end - end - end - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_identification_helper.rb b/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_identification_helper.rb deleted file mode 100644 index 49178478..00000000 --- a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_identification_helper.rb +++ /dev/null @@ -1,16 +0,0 @@ -module SimplyHelpful - module RecordIdentificationHelper - protected - def partial_path(*args, &block) - RecordIdentifier.partial_path(*args, &block) - end - - def dom_class(*args, &block) - RecordIdentifier.dom_class(*args, &block) - end - - def dom_id(*args, &block) - RecordIdentifier.dom_id(*args, &block) - end - end -end diff --git a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_identifier.rb b/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_identifier.rb deleted file mode 100644 index d53afa92..00000000 --- a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_identifier.rb +++ /dev/null @@ -1,44 +0,0 @@ -module SimplyHelpful - module RecordIdentifier - extend self - - def polymorphic_url(record, url_writer) - record.new_record? ? - url_writer.send(plural_class_name(record) + "_url") : - url_writer.send(singular_class_name(record) + "_url", record) - end - - def polymorphic_path(record, url_writer) - record.new_record? ? - url_writer.send(plural_class_name(record) + "_path") : - url_writer.send(singular_class_name(record) + "_path", record) - end - - def partial_path(record_or_class) - klass = class_from_record_or_class(record_or_class) - "#{klass.name.tableize}/#{klass.name.demodulize.underscore}" - end - - def dom_class(record_or_class, prefix = nil) - [ prefix, singular_class_name(record_or_class) ].compact * '_' - end - - def dom_id(record, prefix = nil) - prefix ||= 'new' unless record.id - [ prefix, singular_class_name(record), record.id ].compact * '_' - end - - def plural_class_name(record_or_class) - singular_class_name(record_or_class).pluralize - end - - def singular_class_name(record_or_class) - class_from_record_or_class(record_or_class).name.underscore.tr('/', '_') - end - - private - def class_from_record_or_class(record_or_class) - record_or_class.is_a?(Class) ? record_or_class : record_or_class.class - end - end -end diff --git a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_tag_helper.rb b/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_tag_helper.rb deleted file mode 100644 index cdd046f3..00000000 --- a/tracks/vendor/plugins/simply_helpful/lib/simply_helpful/record_tag_helper.rb +++ /dev/null @@ -1,76 +0,0 @@ -module SimplyHelpful - module RecordTagHelper - # Produces a wrapper DIV element with id and class parameters that - # relate to the specified ActiveRecord object. Usage example: - # - # <% div_for(@person, :class => "foo") do %> - # <%=h @person.name %> - # <% end %> - # - # produces: - # - #
Joe Bloggs
- # - def div_for(record, *args, &block) - content_tag_for(:div, record, *args, &block) - end - - # content_tag_for creates an HTML element with id and class parameters - # that relate to the specified ActiveRecord object. For example: - # - # <% content_tag_for(:tr, @person) do %> - # <%=h @person.first_name %> - # <%=h @person.last_name %> - # <% end %> - # - # would produce hthe following HTML (assuming @person is an instance of - # a Person object, with an id value of 123): - # - # .... - # - # If you require the HTML id attribute to have a prefix, you can specify it: - # - # <% content_tag_for(:tr, @person, :foo) do %> ... - # - # produces: - # - # ... - # - # content_tag_for also accepts a hash of options, which will be converted to - # additional HTML attributes. If you specify a +:class+ value, it will be combined - # with the default class name for your object. For example: - # - # <% content_tag_for(:li, @person, :class => "bar") %>... - # - # produces: - # - #
  • ... - # - def content_tag_for(tag_name, record, *args, &block) - prefix = args.first.is_a?(Hash) ? nil : args.shift - options = args.first.is_a?(Hash) ? args.shift : {} - concat content_tag(tag_name, capture(&block), - options.merge({ :class => "#{dom_class(record)} #{options[:class]}".strip, :id => dom_id(record, prefix) })), - block.binding - end - end -end - -module ActionView - module Helpers - module UrlHelper - def link_to_with_record_identification(attr_name, record = {}, html_options = nil, *parameters_for_method_reference) - case record - when Hash, String, Symbol, NilClass - link_to_without_record_identification(attr_name, record, html_options, *parameters_for_method_reference) - else - url = SimplyHelpful::RecordIdentifier.polymorphic_url(record, self) - link_text = record.respond_to?(attr_name) ? record.send(attr_name) : attr_name - link_to_without_record_identification(link_text, url, html_options, *parameters_for_method_reference) - end - end - - alias_method_chain :link_to, :record_identification - end - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/simply_helpful/test/controller_extensions_test.rb b/tracks/vendor/plugins/simply_helpful/test/controller_extensions_test.rb deleted file mode 100644 index a1a4607c..00000000 --- a/tracks/vendor/plugins/simply_helpful/test/controller_extensions_test.rb +++ /dev/null @@ -1,52 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' -require 'ostruct' - -class RedirectionTestingController < ActionController::Base - class MockResponse - attr_accessor :redirected_to - - def redirect(_) - end - - end - - def initialize - super - @response = MockResponse.new - @request = OpenStruct.new - @request.protocol= "http://" - @request.host_with_port= "www.example.com" - end - - def response - @response - end - - def request - @request - end - - def post_url(p) - "/posts/#{p.id}" - end - - -end - -class ControllerExtensionsTest < Test::Unit::TestCase - def setup - @record = Post.new - @record.save - @controller = RedirectionTestingController.new - end - - def test_redirect_to_record - @controller.send :redirect_to, @record - assert_equal "http://www.example.com/posts/1", @controller.response.redirected_to - end - - def test_redirect_to_string - @controller.send :redirect_to, "http://www.yahoo.com" - assert_equal "http://www.yahoo.com", @controller.response.redirected_to - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/simply_helpful/test/form_helper_extensions_test.rb b/tracks/vendor/plugins/simply_helpful/test/form_helper_extensions_test.rb deleted file mode 100644 index 3e1fa944..00000000 --- a/tracks/vendor/plugins/simply_helpful/test/form_helper_extensions_test.rb +++ /dev/null @@ -1,96 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class LabelledFormBuilder < ActionView::Helpers::FormBuilder - (field_helpers - %w(hidden_field)).each do |selector| - src = <<-END_SRC - def #{selector}(field, *args, &proc) - " " + super + "
    " - end - END_SRC - class_eval src, __FILE__, __LINE__ - end -end - -class FormHelperExtensionsTest < Test::Unit::TestCase - include ActionView::Helpers::FormHelper - include ActionView::Helpers::FormTagHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include ActionView::Helpers::TextHelper - include SimplyHelpful::RecordIdentificationHelper - - def setup - @record = Post.new - @controller = Class.new do - attr_reader :url_for_options - def url_for(options, *parameters_for_method_reference) - @url_for_options = options - @url_for_options || "http://www.example.com" - end - end - @controller = @controller.new - end - - def test_form_for_with_record_identification_with_new_record - _erbout = '' - form_for(@record, {:html => { :id => 'create-post' }}) {} - - expected = "
    " - assert_dom_equal expected, _erbout - end - def test_form_for_with_record_identification_with_custom_builder - _erbout = '' - form_for(@record, :builder => LabelledFormBuilder) do |f| - _erbout.concat(f.text_field(:name)) - end - - expected = "
    " + - "" + - "
    " + - "
    " - assert_dom_equal expected, _erbout - end - - def test_form_for_with_record_identification_without_html_options - _erbout = '' - form_for(@record) {} - - expected = "
    " - assert_dom_equal expected, _erbout - end - - def test_form_for_with_record_identification_with_existing_record - @record.save - _erbout = '' - form_for(@record) {} - - expected = "
    " - assert_dom_equal expected, _erbout - end - - def test_remote_form_for_with_record_identification_with_new_record - _erbout = '' - remote_form_for(@record, {:html => { :id => 'create-post' }}) {} - - expected = %(
    ) - assert_dom_equal expected, _erbout - end - - def test_remote_form_for_with_record_identification_without_html_options - _erbout = '' - remote_form_for(@record) {} - - expected = %(
    ) - assert_dom_equal expected, _erbout - end - - def test_remote_form_for_with_record_identification_with_existing_record - @record.save - _erbout = '' - remote_form_for(@record) {} - - expected = %(
    ) - assert_dom_equal expected, _erbout - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/simply_helpful/test/record_identifier_test.rb b/tracks/vendor/plugins/simply_helpful/test/record_identifier_test.rb deleted file mode 100644 index 516bd554..00000000 --- a/tracks/vendor/plugins/simply_helpful/test/record_identifier_test.rb +++ /dev/null @@ -1,80 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class RecordIdentifierTest < Test::Unit::TestCase - include SimplyHelpful - - def setup - @klass = Post - @record = @klass.new - @singular = 'post' - @plural = 'posts' - end - - def test_dom_id_with_new_record - assert_equal "new_#{@singular}", dom_id(@record) - end - - def test_dom_id_with_new_record_and_prefix - assert_equal "custom_prefix_#{@singular}", dom_id(@record, :custom_prefix) - end - - def test_dom_id_with_saved_record - @record.save - assert_equal "#{@singular}_1", dom_id(@record) - end - - def test_dom_id_with_prefix - @record.save - assert_equal "edit_#{@singular}_1", dom_id(@record, :edit) - end - - def test_partial_path - expected = "#{@plural}/#{@singular}" - assert_equal expected, partial_path(@record) - assert_equal expected, partial_path(Post) - end - - def test_dom_class - assert_equal @singular, dom_class(@record) - end - - def test_dom_class_with_prefix - assert_equal "custom_prefix_#{@singular}", dom_class(@record, :custom_prefix) - end - - def test_singular_class_name - assert_equal @singular, singular_class_name(@record) - end - - def test_singular_class_name_for_class - assert_equal @singular, singular_class_name(@klass) - end - - def test_plural_class_name - assert_equal @plural, plural_class_name(@record) - end - - def test_plural_class_name_for_class - assert_equal @plural, plural_class_name(@klass) - end - - private - def method_missing(method, *args) - RecordIdentifier.send(method, *args) - end -end - -class NestedRecordIdentifierTest < RecordIdentifierTest - def setup - @klass = Post::Nested - @record = @klass.new - @singular = 'post_nested' - @plural = 'post_nesteds' - end - - def test_partial_path - expected = "post/nesteds/nested" - assert_equal expected, partial_path(@record) - assert_equal expected, partial_path(Post::Nested) - end -end diff --git a/tracks/vendor/plugins/simply_helpful/test/record_tag_helper_test.rb b/tracks/vendor/plugins/simply_helpful/test/record_tag_helper_test.rb deleted file mode 100644 index 0ac38dd7..00000000 --- a/tracks/vendor/plugins/simply_helpful/test/record_tag_helper_test.rb +++ /dev/null @@ -1,133 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class RecordTagHelperTest < Test::Unit::TestCase - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include ActionView::Helpers::CaptureHelper - include ActionView::Helpers::TextHelper - include SimplyHelpful::RecordTagHelper - include SimplyHelpful::RecordIdentificationHelper - - def setup - @record = Post.new - end - - def test_content_tag_for_with_new_record - _erbout = '' - content_tag_for(:li, @record) {} - - expected = "
  • " - assert_dom_equal expected, _erbout - end - - def test_content_tag_for_with_existing_record - @record.save - _erbout = '' - content_tag_for(:li, @record) {} - - expected = "
  • " - assert_dom_equal expected, _erbout - end - - def test_content_tag_for_merges_given_class_names - _erbout = '' - content_tag_for(:li, @record, :class => 'foo') {} - - expected = "
  • " - assert_dom_equal expected, _erbout - - _erbout = '' - content_tag_for(:li, @record, :class => 'foo bar') {} - - expected = "
  • " - assert_dom_equal expected, _erbout - end - - def test_content_tag_for_with_dom_id_prefix_on_new_record - _erbout = '' - content_tag_for(:li, @record, :foo, :class => 'foo') {} - - expected = "
  • " - assert_dom_equal expected, _erbout - end - - def test_content_tag_for_with_dom_id_prefix_on_existing_record - @record.save - _erbout = '' - content_tag_for(:li, @record, :foo, :class => 'foo') {} - - expected = "
  • " - assert_dom_equal expected, _erbout - end - - def test_div_for_with_new_record - _erbout = '' - div_for(@record) {} - - expected = "
    " - assert_dom_equal expected, _erbout - end - - def test_div_for_with_existing_record - @record.save - _erbout = '' - div_for(@record) {} - - expected = "
    " - assert_dom_equal expected, _erbout - end - - def test_div_for_merges_given_class_names - _erbout = '' - div_for(@record, :class => 'foo') {} - - expected = "
    " - assert_dom_equal expected, _erbout - - _erbout = '' - div_for(@record, :class => 'foo bar') {} - - expected = "
    " - assert_dom_equal expected, _erbout - end - - def test_div_for_with_dom_id_prefix_on_new_record - _erbout = '' - div_for(@record, :foo, :class => 'foo') {} - - expected = "
    " - assert_dom_equal expected, _erbout - end - - def test_div_for_with_dom_id_prefix_on_existing_record - @record.save - _erbout = '' - div_for(@record, :foo, :class => 'foo') {} - - expected = "
    " - assert_dom_equal expected, _erbout - end - - def test_link_to_with_new_record - actual = link_to :name, @record - - expected = "new post" - assert_dom_equal expected, actual - end - - def test_link_to_with_existing_record - @record.save - actual = link_to :name, @record - - expected = "post #1" - assert_dom_equal expected, actual - end - - def test_link_to_with_an_existing_method_and_constant_text - @record.save - actual = link_to "Cancel Editing", @record - - expected = "Cancel Editing" - assert_dom_equal expected, actual - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/simply_helpful/test/simply_helpful_test.rb b/tracks/vendor/plugins/simply_helpful/test/simply_helpful_test.rb deleted file mode 100644 index d202d3e7..00000000 --- a/tracks/vendor/plugins/simply_helpful/test/simply_helpful_test.rb +++ /dev/null @@ -1,6 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class SimplyHelpfulTest < Test::Unit::TestCase - def default_test - end -end diff --git a/tracks/vendor/plugins/simply_helpful/test/test_helper.rb b/tracks/vendor/plugins/simply_helpful/test/test_helper.rb deleted file mode 100644 index c0888078..00000000 --- a/tracks/vendor/plugins/simply_helpful/test/test_helper.rb +++ /dev/null @@ -1,25 +0,0 @@ -RAILS_ENV = 'test' -require File.expand_path(File.join(File.dirname(__FILE__), '../../../../config/environment.rb')) -require 'action_controller/test_process' -require 'breakpoint' - -class Post - attr_reader :id - def save; @id = 1 end - def new_record?; @id.nil? end - def name - @id.nil? ? 'new post' : "post ##{@id}" - end - class Nested < Post; end -end - -class Test::Unit::TestCase - protected - def posts_url - 'http://www.example.com/posts' - end - - def post_url(post) - "http://www.example.com/posts/#{post.id}" - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/CHANGELOG b/tracks/vendor/plugins/unobtrusive_javascript/CHANGELOG deleted file mode 100644 index e5e784cd..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/CHANGELOG +++ /dev/null @@ -1,72 +0,0 @@ -== rel-0.3.2 -* FIXED: Error when trying to convert nil from hash (ticket #8) - -* FIXED: Got tests running inside a Rails app - -* UPDATED: Refactored BehaviourScriptConverter - -== rel-0.3.1 -* FIXED: Issues with Rails edge have now been resolved. Have changed the UnobtrusiveJavascript module to UJS. This has one API change - use UJS::Routes in routes.rb - -* FIXED: Major issue when restarting server (server just hangs) due to serializing of behaviour scripts to the session. Objects are now converted to and from a hash before serializing to the session. All reports suggest that this has fixed the issue. Please raise a ticket if you get any more weird errors. - -* FIXED: remote_function was incorrectly quoting JS (ticket #3) - -* FIXED: :external => false now works for apply_behaviours (ticket #5) - -* FIXED: element.replace_html inside Ruby behaviour block wasn't working, this is now fixed (ticket #4) - -* FIXED: behaviours_url now works correctly when using mongrel url-prefix (ticket #6) - -* FIXED: Resolved some documentation issues - -== rel-0.3 -* FIXED: Problems with rake:unobtrusive_javascript:install (ticket #12 on old trac) - -* FIXED: Problems with back button (result of caching feature) (ticket #10 on old trac) - -* Refactored a lot of the code and increased test coverage significantly - -* NEW: Out-of-the box caching using HTTP ETags and advanced behaviour caching - -* NEW: Apply multiple behaviours at once with apply_behaviours - -* NEW: Behaviour helpers to easily and unobtrusively apply scriptaculous effects - -* UPDATED: Updated lowpro.js library - -* UPDATED: Added :external option support to tag_options - -* NEW: :prevent_default option to cancel original event behaviour such as link following and form submission - -== rel-0.2.2 -* FIXED: Change the way tag_options detects javascript events, using blank? instead of include? as some Rails helpers insert an empty onclick handler. - -== rel-0.2.1 -* FIXED: Added an about.yml file - bad Luke - practice what you preach! - -* FIXED: Fixed the plugin in edge rails by explicitly requiring the controller file - -== rel-0.2 - -* UPDATED: register_js_behaviour has been renamed to apply_behaviour and now takes an optional options hash and a block, which allows you to write your behaviours in pure Ruby. register_js_behaviour remains as an alias for backwards compatibility but is officially deprecated; it will probably be removed in the next release. There are also aliases for the American spelling of behaviour for our friends on the other side of the pond. - -* NEW: You can now attach behaviours directly to elements using content_tag and tag by passing in javascript event handlers in the HTML options hash (:onclick, :onmousedown etc.) - they'll be extracted to the external behaviours file automatically. - -* UPDATED: The core Rails AJAX/Javascript helpers (link_to_remote, button_to_function, link_to_function, form_remote_tag etc.) now work out of the box. - -* NEW: There is no need to explicitly specify an HTML ID for the elements you want to attach behaviour to - if you don't, one will be generated automatically for you. - -* NEW: Options to render behaviour rules directly in your page inside script blocks instead of in the external behaviour file. - -* FIXED: Behaviours inside AJAX-loaded partials will now work. - -* UPDATED: event:Selectors and domReady javascript libraries are replaced with the lowPro.js library by Dan Webb - -* UPDATED: Javascript behaviours now have access to a single variable - event. To access the element the event was applied to, use this. - -* UPDATED: Behaviours can now cancel the default action by returning false as well as using Event.stop(event) - -* FIXED: The required javascript files will be copied to your public folder automatically on installation. There is also a rake task for copying files across when upgrading the plugin. - -* NEW: Lots more documentation! \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/README b/tracks/vendor/plugins/unobtrusive_javascript/README deleted file mode 100644 index 11951219..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/README +++ /dev/null @@ -1,73 +0,0 @@ -= Unobtrusive Javascript for Rails Version 0.3.2 - -Please see www.ujs4rails.com for full documentation, articles and updates. - -The Unobtrusive Javascript plugin for Rails allows you to attach Javascript behaviour and events to your page elements using pure Ruby, from within your controller or view, without clogging up your rendered HTML with Javascript - either inline or in the head of your document. - -== Installation - -The recommended way of installing the plugin is to take advantage of Subversion's svn:externals feature. From within your Rails app root, enter the following on the command line: - - $ ./script/plugin install -x http://opensource.agileevolved.com/svn/root/rails_plugins/unobtrusive_javascript/tags/rel-0.2 unobtrusive_javascript - -If you are upgrading from a previous version remember to update your applications javascripts with: - - rake unobtrusive_javascript:install - -Finally, add the necessary routes to config/routes.rb by adding: - - UJS.routes - -To the Routes.draw block. - -== Including the necessary libraries and behaviours file - -The only modification you need to make to your app is to add the following line somewhere in the head of your app's layout: - - <%= javascript_include_tag 'prototype', :unobtrusive %> - -You're now up and running with unobtrusive javascript functionality. - -== Registering javascript behaviours - -The plugin offers a simple, low-level function for attaching behaviours to elements of your page using the +register_js_behaviour+ function. - - <%= apply_behaviour "#coolink:click", "alert('Hello world!')" %> - -You can also pass a block to the function that lets you write your javascript behaviours using ruby: - - <%= apply_behaviour "#sayhellothenfade:click" do |page, element, event| - page.alert "Hello, I'm gonna fade..." - element.visual_effect :fade - end %> - -See the API documentation for more usage examples. - -=== Rendering behaviours inside script blocks instead of an external file - -By default, all unobtrusive behaviours will be rendered in an external javascript file, generated at runtime. Sometimes, you may want to embed the behaviours directly in a page, inside script tags. You can do this by passing the option :external => false to register_js_behaviour. - - <%= apply_behaviour "#coolink:click", "alert('Hello world!')", :external => false %> - -One of the main reasons to render javascript inside javascript tags instead of the external file is when you are embedding behaviours inside partials that are loaded into your page using AJAX. Because the external javascript file will already have been generated, any subsequent behaviours inside your AJAX-loaded partials will not register. For this reason the behaviours need to be rendered inside normal script tags. The unobtrusive_javascript plugin takes care of this for you automatically - any behaviours registered inside an AJAX-loaded partial will be rendered inside a script element without having to specify :external => false manually. - -== Attaching behaviours directly to elements using Rails' tag generators - -Rails comes with two built-in tag generator helpers - tag and content_tag. You can use these helpers to generate HTML elements and attach behaviour to them by directly specifying the events as part of the helpers' html options hash. The behaviours will be extracted and moved into the external behaviours file instead of being rendered inline. - - <%= content_tag "div", "Click Me", :onclick => "alert('You clicked me')" %> - -The full range of javascript events are available through this method. - -The above functionality is achieved with a patch to Rails' tag_options function. Because of this patch, most of Rails' javascript/ajax helpers (or any helper that generates HTML using the tag_options function and that accepts an HTML options hash) will work in an unobtrusive fashion out of the box. The list of helpers that currently work unobtrusively include: - -* link_to_remote -* link_to_function -* button_to_function -* form_remote_tag -* submit_to_remote - -== Credits - -The unobtrusive_javascript plugin is by Luke Redpath (http://www.lukeredpath.co.uk) and Dan Webb (http://www.vivabit.com/bollocks). The plugin also makes use of the Low Pro JavaScript library also by -Dan Webb, parts of which were heavily inspired by Justin Palmer's excellent event:Selectors (http://encytemedia.com/eventselectors/). \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/Rakefile b/tracks/vendor/plugins/unobtrusive_javascript/Rakefile deleted file mode 100644 index e1a7326f..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/Rakefile +++ /dev/null @@ -1,33 +0,0 @@ -require 'rake' -require 'rake/testtask' -require 'rake/rdoctask' -require 'fileutils' - -desc 'Default: run unit tests.' -task :default => :test - -desc 'Test the unobtrusive_javascript plugin.' -Rake::TestTask.new(:test) do |t| - t.libs << 'lib' - t.pattern = 'test/**/*_test.rb' - t.verbose = true -end - -desc 'Generate documentation for the unobtrusive_javascript plugin.' -Rake::RDocTask.new(:rdoc) do |rdoc| - rdoc.rdoc_dir = 'rdoc' - rdoc.title = 'UJS' - rdoc.options << '--line-numbers' << '--inline-source' << '--accessor=cattr_accessor' - rdoc.rdoc_files.include('README') - rdoc.rdoc_files.include('lib/**/*.rb') -end - -desc 'Updates application with the necessary javascripts for unobtrusive_javascript.' -task :update_scripts do - FileUtils.cp Dir['assets/javascripts/*.js'], '../../../public/javascripts' -end - -desc 'Removes the javascripts for the plugin.' -task :remove_scripts do - FileUtils.rm %{lowpro.js}.collect { |f| "../../../public/javascripts/" + f } -end diff --git a/tracks/vendor/plugins/unobtrusive_javascript/about.yml b/tracks/vendor/plugins/unobtrusive_javascript/about.yml deleted file mode 100644 index 80d8a995..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/about.yml +++ /dev/null @@ -1,6 +0,0 @@ -author: Luke Redpath & Dan Webb -summary: Makes adding javascript behaviour easy and enhances existing Rails javascript/ajax helpers. -homepage: http://www.ujs4rails.com -plugin: http://source.ujs4rails.com -license: MIT -version: 0.3 \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/assets/javascripts/lowpro.js b/tracks/vendor/plugins/unobtrusive_javascript/assets/javascripts/lowpro.js deleted file mode 100644 index c0124e61..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/assets/javascripts/lowpro.js +++ /dev/null @@ -1,307 +0,0 @@ -LowPro = {}; -LowPro.Version = '0.1'; - -// Adapted from DOM Ready extension by Dan Webb -// http://www.vivabit.com/bollocks/2006/06/21/a-dom-ready-extension-for-prototype -// which was based on work by Matthias Miller, Dean Edwards and John Resig -// -// Usage: -// -// Event.onReady(callbackFunction); -Object.extend(Event, { - _domReady : function() { - if (arguments.callee.done) return; - arguments.callee.done = true; - - if (Event._timer) clearInterval(Event._timer); - - Event._readyCallbacks.each(function(f) { f() }); - Event._readyCallbacks = null; - - }, - onReady : function(f) { - if (!this._readyCallbacks) { - var domReady = this._domReady; - - if (domReady.done) return f(); - - if (document.addEventListener) - document.addEventListener("DOMContentLoaded", domReady, false); - - /*@cc_on @*/ - /*@if (@_win32) - document.write("') - end - - def test_should_render_script_tag_for_current_requests_behaviour - assert @output.include?('') - end - - def test_should_render_index_behaviour_when_request_path_is_just_a_forward_slash - @controller.request.stubs(:path).returns('/') - @output = javascript_include_tag(:unobtrusive).split("\n") - assert @output.include?('') - end - - def test_should_render_index_behaviour_when_request_path_is_blank_as_a_result_of_a_url_prefix - @controller.request.stubs(:path).returns('') - @output = javascript_include_tag(:unobtrusive).split("\n") - assert @output.include?('') - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_helper_test.rb b/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_helper_test.rb deleted file mode 100644 index f8c800b3..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_helper_test.rb +++ /dev/null @@ -1,180 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' -require 'prototype_helper_patches' -require 'scriptaculous_helper_patches' -require 'ujs/behaviour_helper' - -class MakeSortableTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include UJS::BehaviourHelper - - def setup - initialize_test_request - end - - def test_should_output_sortable_javascript - output = make_sortable - - assert_equal sortable_element_js(javascript_variable('this')), output - end - - def test_should_pass_arguments_through - output = make_sortable :onUpdate => 'function() { alert("updated") }' - assert_equal 'Sortable.create(this, {onUpdate:function() { alert("updated") }});', output - end -end - -class MakeRemoteLinkTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include UJS::BehaviourHelper - - def setup - initialize_test_request - end - - def test_should_generate_ajax_request - output = make_remote_link - assert_match(/new Ajax\.Request/, output) - end - - def test_should_default_to_element_href - output = make_remote_link - assert_match(/\(this\.href/, output) - end - - def test_should_respond_to_given_options - output = make_remote_link( :update => 'fartknocker' ) - assert_match(/new Ajax\.Updater\('fartknocker'/, output) - end -end - -class MakeRemoteFormTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include UJS::BehaviourHelper - - def setup - initialize_test_request - end - - def test_should_generate_ajax_request - output = make_remote_form - assert_match(/new Ajax\.Request/, output) - end - - def test_should_default_to_form_action - output = make_remote_form - assert_match(/\(this\.action/, output) - end -end - -class MakeDraggableTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include UJS::BehaviourHelper - - def setup - initialize_test_request - end - - def test_should_create_draggable_instance - output = make_draggable - assert_match(/new Draggable/, output) - end - - def test_should_pass_this - output = make_draggable - assert_match(/\(this/, output) - end - - def test_should_respond_to_options - output = make_draggable( :revert => true ) - assert_match(/revert\:true/, output) - end -end - -class MakeDropRecievingTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include UJS::BehaviourHelper - - def setup - initialize_test_request - end - - def test_should_add_to_droppables - output = make_drop_receiving - assert_match(/Droppables\.add/, output) - end - - def test_should_pass_this - output = make_drop_receiving - assert_match(/\(this/, output) - end - - def test_should_generate_a_url_from_options - output = make_drop_receiving( :url => { :action => "bingo" } ) - assert_match(/controller_stub\/bingo/, output) - end -end - -class MakeObservedTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include UJS::BehaviourHelper - - def setup - initialize_test_request - end - - def test_should_make_form_observer - output = make_observed(:form) - assert_match(/new Form\.EventObserver/, output) - end - - def test_should_make_field_observer - output = make_observed(:field) - assert_match(/new Form\.Element\.EventObserver/, output) - end - - def test_should_pass_this - output = make_observed(:field) - assert_match(/\(this/, output) - end - - def test_should_make_a_timed_observer_if_frequency_passed - output = make_observed(:form, :frequency => 3 ) - assert_match(/new Form.Observer/, output) - assert_match(/3,/, output) - end - - def test_should_generate_a_url_from_options - output = make_observed(:field, :url => { :action => "bingo" } ) - assert_match(/controller_stub\/bingo/, output) - end - - def test_should_respond_to_options - output = make_observed(:field, :function => 'alert("boo")' ) - assert_match(/function\(element, value\) \{alert\("boo"\)\}/, output) - end -end - diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_script_converter_test.rb b/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_script_converter_test.rb deleted file mode 100644 index e403ed33..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_script_converter_test.rb +++ /dev/null @@ -1,72 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class DefaultBehaviourScriptConversionTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - @output = UJS::BehaviourScriptConverter.convert_to_hash(@script) - end - - def test_should_have_no_rules_and_the_correct_default_options - assert_equal({ :options => { :cache => false, :reapply_after_ajax => true }, - :rules => [] }, @output) - end -end - -class EmptyBehaviourScriptWithDifferentOptionsConversionTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new(true, false) - @output = UJS::BehaviourScriptConverter.convert_to_hash(@script) - end - - def test_should_have_no_rules_and_the_correct_options - assert_equal({ :options => { :cache => true, :reapply_after_ajax => false }, - :rules => [] }, @output) - end -end - -class BehaviourScriptWithOneRuleConversionTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - @script.add_rule('div.foo:click', 'alert("TEST")') - @output = UJS::BehaviourScriptConverter.convert_to_hash(@script) - end - - def test_should_have_one_behaviour_and_correct_options - assert_equal({ :options => { :cache => false, :reapply_after_ajax => true }, - :rules => [ - ['div.foo:click', 'alert("TEST")'] - ] }, @output) - end -end - -class BehaviourScriptWithTwoRuleConversionTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - @script.add_rule('div.foo:click', 'alert("TEST")') - @script.add_rule('div.bar:click', 'alert("TEST 2")') - @output = UJS::BehaviourScriptConverter.convert_to_hash(@script) - end - - def test_should_have_one_behaviour_and_correct_options - assert_equal({ :options => { :cache => false, :reapply_after_ajax => true }, - :rules => [ - ['div.foo:click', 'alert("TEST")'], - ['div.bar:click', 'alert("TEST 2")'] - ] }, @output) - end -end - -class BehaviourScriptFromHashTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - @script.add_rule('div.foo:click', 'alert("TEST")') - @script.add_rule('div.bar:click', 'alert("TEST 2")') - @converted_script = UJS::BehaviourScriptConverter.convert_from_hash(@script.to_hash) - end - - def test_should_equal_the_script_it_was_converted_from_in_the_first_place - assert_equal @script.cache?, @converted_script.cache? - assert_equal @script.reapply_after_ajax?, @converted_script.reapply_after_ajax? - assert_equal @script.rules, @converted_script.rules - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_script_test.rb b/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_script_test.rb deleted file mode 100644 index 33e1f671..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/behaviour_script_test.rb +++ /dev/null @@ -1,98 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' -require 'ujs/behaviour_script' - -class NewBehaviourScriptTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - end - - def test_should_render_nothing_on_to_string - assert_equal "", @script.to_s - end - - def test_should_not_be_cached - assert !@script.cache? - end - - def test_should_be_reapplied_after_an_ajax_request - assert @script.reapply_after_ajax? - end -end - -class BehaviourScriptWithOneRuleTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - @script.add_rule("div.header:click", "alert('Hello World')") - end - - def test_should_render_the_rule_as_a_javascript_event_on_to_s - expected_js = "Event.addBehavior({\n\"div.header:click\": function(event) {\nalert('Hello World')\n}\n});" - assert_equal expected_js, @script.to_s - end -end - -class BehaviourScriptWithTwoRulesTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - @script.add_rule("div.header:mouseover", "alert('Hello World')") - @script.add_rule("div.header:mouseout", "alert('Goodbye World')") - end - - def test_should_render_all_rules_as_javascript_events_on_to_s - expected_js = "Event.addBehavior({\n\"div.header:mouseover\": function(event) {\nalert('Hello World')\n}," - expected_js = expected_js + "\n\"div.header:mouseout\": function(event) {\nalert('Goodbye World')\n}\n});" - assert_equal expected_js, @script.to_s - end -end - -class BehaviourScriptWithRuleThatCancelsDefaultTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - @script.add_rule("div.header:mouseover", "alert('Hello World');", true) - end - - def test_should_render_rule_with_return_false_appended_on_to_s - expected_js = "Event.addBehavior({\n\"div.header:mouseover\": function(event) {\nalert('Hello World'); return false;\n}\n});" - assert_equal expected_js, @script.to_s - end -end - -class BehaviourScriptWithNoRulesTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - end - - def test_should_render_nothing_on_to_s - assert_equal "", @script.to_s - end -end - -class BehaviourScriptWithRulesSetToNotReapplyAfterAjaxTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new - @script.reapply_after_ajax = false - @script.add_rule("div.header:click", "alert('Hello World')") - end - - def test_should_append_reapply_javascript_to_end_of_rules_javascript_on_to_s - expected_js = "Event.addBehavior({\n\"div.header:click\": function(event) {\nalert('Hello World')\n}\n});" - expected_js = expected_js + "\nEvent.addBehavior.reapplyAfterAjax = false;" - assert_equal expected_js, @script.to_s - end -end - -class BehaviourScriptToHashTest < Test::Unit::TestCase - def setup - @script = UJS::BehaviourScript.new(true, false) - @script.add_rule("div.header:mouseover", "alert('Hello World')") - @script.add_rule("div.header:mouseout", "alert('Goodbye World')") - end - - def test_should_return_converted_behaviour_script - assert_equal({ :options => { :cache => true, :reapply_after_ajax => false }, - :rules => [ - ['div.header:mouseover', "alert('Hello World')"], - ['div.header:mouseout', "alert('Goodbye World')"] - ] }, @script.to_hash) - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/config/database.yml b/tracks/vendor/plugins/unobtrusive_javascript/test/config/database.yml deleted file mode 100644 index bafaf2ab..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/config/database.yml +++ /dev/null @@ -1,19 +0,0 @@ -test: - adapter: sqlite3 - dbfile: test.sqlite3.db - -# adapter: sqlite -# dbfile: test.sqlite.db - -# adapter: mysql -# host: localhost -# username: -# password: -# database: test - -# adapter: postgresql -# host: localhost -# username: -# password: -# database: test - diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/config/environment.rb b/tracks/vendor/plugins/unobtrusive_javascript/test/config/environment.rb deleted file mode 100644 index 47ed1736..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/config/environment.rb +++ /dev/null @@ -1,8 +0,0 @@ -Rails::Initializer.run do |config| - config.cache_classes = true - config.whiny_nils = true - config.action_controller.consider_all_requests_local = true - config.action_controller.perform_caching = false - config.action_mailer.delivery_method = :test - config.action_mailer.perform_deliveries = true -end \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/config/routes.rb b/tracks/vendor/plugins/unobtrusive_javascript/test/config/routes.rb deleted file mode 100644 index d7da080e..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/config/routes.rb +++ /dev/null @@ -1,4 +0,0 @@ -ActionController::Routing::Routes.draw do |map| - map.connect ':controller/:action/:id' - UJS::routes -end \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/config/schema.rb b/tracks/vendor/plugins/unobtrusive_javascript/test/config/schema.rb deleted file mode 100644 index 4c9c90fe..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/config/schema.rb +++ /dev/null @@ -1,3 +0,0 @@ -ActiveRecord::Schema.define(:version => 2) do - -end \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/controller_methods_test.rb b/tracks/vendor/plugins/unobtrusive_javascript/test/controller_methods_test.rb deleted file mode 100644 index 1f9eaa65..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/controller_methods_test.rb +++ /dev/null @@ -1,48 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class ControllerWithControllerMethodsInjected < Test::Unit::TestCase - def setup - @controller = ControllerStub.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - get :index - end - - def test_should_add_a_before_filter_that_creates_a_new_behaviour_script - assert ControllerStub.before_filters.include?(:initialise_js_behaviours) - assert_instance_of UJS::BehaviourScript, assigns(:js_behaviours) - assert_equal "", assigns(:js_behaviours).to_s - end - - def test_should_store_applied_behaviours_in_the_behaviour_script - @controller.apply_behaviour("div.foo", "alert('foo')") - assert_equal 1, assigns(:js_behaviours).rules.size - end - - def test_should_add_an_after_filter_that_stores_the_behaviour_script_in_the_session_as_a_hash - assert ControllerStub.after_filters.include?(:store_js_behaviours) - assert_equal session[:js_behaviours], assigns(:js_behaviours).to_hash - end - - def test_should_not_store_behaviour_script_in_the_session_if_js_behaviours_is_nil - @controller.send(:reset_js_behaviours) - assert_nil @controller.send(:js_behaviours) - end - - def test_should_turn_behaviour_script_caching_on_when_cache_behaviours_is_called - @controller.cache_behaviours - assert assigns(:js_behaviours).cache? - end - - def test_should_toggle_reload_after_ajax_when_set - @controller.reapply_behaviours_after_ajax = false - assert !assigns(:js_behaviours).reapply_after_ajax? - @controller.reapply_behaviours_after_ajax = true - assert assigns(:js_behaviours).reapply_after_ajax? - end - - def test_should_also_allow_american_spelling_for_apply_behaviour - @controller.apply_behavior("div.foo", "alert('foo')") - assert_equal 1, assigns(:js_behaviours).rules.size - end -end \ No newline at end of file diff --git a/tracks/vendor/plugins/unobtrusive_javascript/test/helpers_test.rb b/tracks/vendor/plugins/unobtrusive_javascript/test/helpers_test.rb deleted file mode 100644 index 405e0a50..00000000 --- a/tracks/vendor/plugins/unobtrusive_javascript/test/helpers_test.rb +++ /dev/null @@ -1,186 +0,0 @@ -require File.dirname(__FILE__) + '/test_helper' - -class ApplyingBehaviourWithStringOfJavascriptTest < Test::Unit::TestCase - include UJS::Helpers - - def setup - @controller = ControllerStub.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - get :index - @output = apply_behaviour("#mydiv:click", "alert('hello world')") - end - - def test_should_store_registered_behaviour - assert_equal 1, assigns(:js_behaviours).rules.size - assert_equal "#mydiv:click", assigns(:js_behaviours).rules.first[0] - assert_equal "alert('hello world');", assigns(:js_behaviours).rules.first[1] - end -end - -class ApplyingBehaviourThatIsRendererdInlineTest < Test::Unit::TestCase - include UJS::Helpers - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::TagHelper - - def setup - @controller = ControllerStub.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - get :index - @output = apply_behaviour("#mydiv:click", "alert('hello world')", :external => false) - end - - def test_should_not_store_registered_behaviour - assert_equal 0, assigns(:js_behaviours).rules.size - end -end - -class PreventDefaultBehaviourOptionTest < Test::Unit::TestCase - include UJS::Helpers - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::TagHelper - - def setup - @controller = ControllerStub.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - get :index - @output = apply_behaviour("#mydiv:click", "alert('hello world')", :prevent_default => true) - end - - def test_should_return_false_with_prevent_default - assert_equal ['#mydiv:click', "alert('hello world'); return false;"], assigns(:js_behaviours).rules.last - end -end - -class ApplyingBehaviourWithBlockTest < Test::Unit::TestCase - include UJS::Helpers - - def setup - @controller = ControllerStub.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - get :index - end - - def test_should_use_page_argument - apply_behaviour '#thing' do |page| - page.alert('hello') - end - - assert_equal '#thing', assigns(:js_behaviours).rules.last[0] - assert_equal "alert(\"hello\");", assigns(:js_behaviours).rules.last[1] - end - - def test_should_use_element_argument - apply_behaviour '#thing' do |page, element| - element.hide - end - - assert_equal '#thing', assigns(:js_behaviours).rules.last[0] - assert_equal "this.hide();", assigns(:js_behaviours).rules.last[1] - end - - def test_should_use_event_argument - apply_behaviour '#thing' do |page, element, event| - event.stop - end - - assert_equal '#thing', assigns(:js_behaviours).rules.last[0] - assert_equal "Event.stop(event);", assigns(:js_behaviours).rules.last[1] - end - - def test_should_use_allow_multiple_calls - apply_behaviour '#thing' do |page, element, event| - page.alert('hiding thing') - element.hide - element.show - event.stop - end - - assert_equal '#thing', assigns(:js_behaviours).rules.last[0] - assert_equal "alert(\"hiding thing\");\nthis.hide();\nthis.show();\nEvent.stop(event);", assigns(:js_behaviours).rules.last[1] - end - - def test_should_allow_options_with_block_without_specifying_string - apply_behaviour '#thing2', :prevent_default => true do |page| - page.alert('boo') - end - - assert_equal '#thing2', assigns(:js_behaviours).rules.last[0] - assert_equal "alert(\"boo\"); return false;", assigns(:js_behaviours).rules.last[1] - end - - def test_should_allow_element_proxy_methods_to_be_called - apply_behaviour '#thing3' do |page, element| - element.replace_html 'Wow!' - end - - assert_equal '#thing3', assigns(:js_behaviours).rules.last[0] - assert_equal "this.update(\"Wow!\");", assigns(:js_behaviours).rules.last[1] - end -end - -class MultipleBehavioursAppliedAtOnceTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include UJS::BehaviourHelper - include UJS::Helpers - - def setup - @controller = ControllerStub.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - get :index - apply_behaviours do - on "div.foo", "alert('foo')" - on "div.bar", "alert('bar')" - end - end - - def test_should_all_get_registered_in_the_behaviour_script - assert_equal 2, assigns(:js_behaviours).rules.size - end - - def test_should_work_with_apply_behaviour_helpers - apply_behaviours do - on "ul.sortable", make_sortable - end - assert_equal 3, assigns(:js_behaviours).rules.size - end -end - -class MultipleBehavioursAppliedAtOnceWithExternalFalseTest < Test::Unit::TestCase - include ActionView::Helpers::JavaScriptHelper - include ActionView::Helpers::ScriptaculousHelper - include ActionView::Helpers::PrototypeHelper - include ActionView::Helpers::UrlHelper - include ActionView::Helpers::TagHelper - include UJS::BehaviourHelper - include UJS::Helpers - - def setup - @controller = ControllerStub.new - @request = ActionController::TestRequest.new - @response = ActionController::TestResponse.new - get :index - @output = apply_behaviours do - on "div.foo", "alert('foo')", :external => false - on "div.bar", :external => false do |page| - page.alert('bar') - end - end - end - - def test_should_output_behaviours - assert_not_equal '', @output - assert_match(/