Skip to content

Commit

Permalink
more robust acceptance tests, memcache store is a poor choice for def…
Browse files Browse the repository at this point in the history
…aults imo, minimize the amount of inclusions required for selenium tests
  • Loading branch information
atmos committed Feb 15, 2009
1 parent 25567fa commit 40043f7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
log
db/schema.rb
db/*.sqlite3

tmp
6 changes: 5 additions & 1 deletion config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# If you change this key, all old sessions will become invalid!
# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
config.action_controller.session_store = :mem_cache_store
#config.action_controller.session_store = :mem_cache_store
config.action_controller.session = {
:session_key => '_twitloc_session',
:expires => 4 * 3600,
Expand All @@ -74,4 +74,8 @@
# Activate observers that should always be running
# Please note that observers generated using script/generate observer need to have an _observer suffix
# config.active_record.observers = :cacher, :garbage_collector, :forum_observer
# config.gem "atmos-webrat", :lib => "webrat", :source => "http://gems.github.com"
config.gem "ubermajestix-twitter", :lib => "twitter", :source => "http://gems.github.com"
config.gem "rspec", :lib => "spec"

end
2 changes: 1 addition & 1 deletion test/integration/visiting_twitplot_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class VisitingTwitplotTest < ActionController::IntegrationTest
# Replace this with your real tests.
test "the truth" do
test "visiting / and clicking search" do
visit '/'
assert_have_selector 'div#about'
assert_have_selector 'div#results'
Expand Down
33 changes: 9 additions & 24 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
ENV["RAILS_ENV"] = "test"
require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
require 'test_help'
require 'webrat'
require 'webrat/selenium'
require 'spec'

class Test::Unit::TestCase
self.use_transactional_fixtures = true
Expand All @@ -16,27 +15,13 @@ class Test::Unit::TestCase

# Add more helper methods to be used by all tests here...
end
if ENV['SELENIUM']
module ActionController #:nodoc:
IntegrationTest.class_eval do
include Webrat::Selenium::Methods
include Webrat::Selenium::Matchers
end
end
end

Webrat.configure do |config|
if ENV['SELENIUM']
module ActionController #:nodoc:
IntegrationTest.class_eval do
include Webrat::Selenium::Methods
include Webrat::Selenium::Matchers
end
end
config.mode = :selenium
else
config.mode = :rails
end
if ENV['SELENIUM']
require 'webrat/selenium'
Webrat.configuration.application_port = 4567
Webrat.configuration.application_environment = 'test'
Webrat.configuration.mode = :selenium
else
require 'webrat/rails'
Webrat.configuration.mode = :rails
end


0 comments on commit 40043f7

Please sign in to comment.