Permalink
Browse files

Update the application server factory to allow use of the RailsUnicor…

…n app server.
  • Loading branch information...
1 parent ef7c834 commit cd548efc90fffcbd5f93938a3fcdeeb588a8897e @jwinky committed May 25, 2011
@@ -14,6 +14,9 @@ def self.app_server_instance
when :rails
require "webrat/selenium/application_servers/rails"
return Webrat::Selenium::ApplicationServers::Rails.new
+ when :rails_unicorn
+ require "webrat/selenium/application_servers/rails_unicorn"
+ return Webrat::Selenium::ApplicationServers::RailsUnicorn.new
when :rack
require "webrat/selenium/application_servers/rack"
return Webrat::Selenium::ApplicationServers::Rack.new
@@ -31,6 +31,14 @@
Webrat::Selenium::ApplicationServerFactory.app_server_instance
end
+ it "should require and create a rails unicorn server in rails_unicorn mode" do
+ server = mock(Webrat::Selenium::ApplicationServers::RailsUnicorn)
+ Webrat.configuration.application_framework = :rails_unicorn
+ Webrat::Selenium::ApplicationServerFactory.should_receive(:require).with("webrat/selenium/application_servers/rails_unicorn")
+ Webrat::Selenium::ApplicationServers::RailsUnicorn.should_receive(:new).and_return(server)
+ Webrat::Selenium::ApplicationServerFactory.app_server_instance
+ end
+
it "should require and create a rails server in external mode" do
server = mock(Webrat::Selenium::ApplicationServers::External)
Webrat.configuration.application_framework = :external

0 comments on commit cd548ef

Please sign in to comment.