aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/environments/test.rb2
-rw-r--r--spec/support/devise.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 2d2e45717..cefbcd8af 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -31,6 +31,7 @@ ChouetteIhm::Application.configure do
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
# Use SQL instead of Active Record's schema dumper when creating the test database.
# This is necessary if your schema can't be completely dumped by the schema dumper,
@@ -40,6 +41,7 @@ ChouetteIhm::Application.configure do
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
+
config.to_prepare do
Chouette::Command.command = "true"
end
diff --git a/spec/support/devise.rb b/spec/support/devise.rb
index 4e0e3a4d2..b50f3a71a 100644
--- a/spec/support/devise.rb
+++ b/spec/support/devise.rb
@@ -4,6 +4,7 @@ module DeviseRequestHelper
def login_user
organisation = Organisation.find_by_name("first") || create(:organisation, :name => "first")
@user ||= create(:user, :organisation => organisation)
+ @user.confirm!
login_as @user, :scope => :user
# post_via_redirect user_session_path, 'user[email]' => @user.email, 'user[password]' => @user.password
end
@@ -34,7 +35,9 @@ module DeviseControllerHelper
before(:each) do
@request.env["devise.mapping"] = Devise.mappings[:user]
organisation = Organisation.find_by_name("first") || create(:organisation, :name => "first")
- sign_in create(:user, :organisation => organisation)
+ user = create(:user, :organisation => organisation)
+ user.confirm!
+ sign_in user
end
end
end