Stop setting host for url helpers in specs

This commit is contained in:
Rob Harrington
2017-07-06 12:43:38 +10:00
parent 7b456461f3
commit dd56e03be1
5 changed files with 5 additions and 4 deletions

View File

@@ -45,7 +45,6 @@ Openfoodnetwork::Application.configure do
# Print deprecation notices to the stderr
config.active_support.deprecation = :stderr
config.action_mailer.default_url_options = { :host => "test.host" }
# To block requests before running the database cleaner
require 'open_food_network/rack_request_blocker'
@@ -55,3 +54,4 @@ end
# Allows us to use _url helpers in Rspec
Rails.application.routes.default_url_options[:host] = 'test.host'
Spree::Core::Engine.routes.default_url_options[:host] = 'test.host'

View File

@@ -12,7 +12,7 @@ describe Spree::Admin::ProductsController do
end
it "denies access" do
response.should redirect_to "http://test.host/unauthorized"
response.should redirect_to spree.unauthorized_url
end
it "does not update any product" do

View File

@@ -6,7 +6,6 @@ describe UserPasswordsController do
before do
@request.env["devise.mapping"] = Devise.mappings[:spree_user]
ActionMailer::Base.default_url_options[:host] = "test.host"
end
describe "create" do

View File

@@ -204,7 +204,6 @@ feature %q{
end
context "viewing the edit page" do
before { Rails.application.routes.default_url_options[:host] = "test.host" }
it "shows the dropdown menu" do
distributor1.update_attribute(:abn, '12345678')
order = create(:completed_order_with_totals, distributor: distributor1)

View File

@@ -47,6 +47,9 @@ Capybara.default_max_wait_time = 30
require "paperclip/matchers"
# Override setting in Spree engine: Spree::Core::MailSettings
ActionMailer::Base.default_url_options[:host] = 'test.host'
RSpec.configure do |config|
# ## Mock Framework
#