Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for issue #75 and missing host exception #77

Merged
merged 2 commits into from

2 participants

@vongruenigen

This commit fixes the issue I described in #75. The problem was that it tried to get the application from the Rails constant defined in your module rather than the top level Rails constant.

@vongruenigen vongruenigen reopened this
@vongruenigen

Sorry for accidently closing the PR. Hmm @blowmage, don't know why the tests are failing and currently I can't spend any time on investigate why. Do you have time to take a look at it?

@vongruenigen vongruenigen include #url_options method
include #url_options method from https://github.com/rails/rails/blob/v3.2.8/actionpack/lib/action_dispatch/testing/integration.rb#L494
because otherwise you have to specify a host foreach url you want to generate dynamically in an integration test
48b862b
@vongruenigen

I just fixed another problem I was facing. When you want to generate a url through a url_helper (e.g. home_url) the following exception was thrown:

Missing host to link to! Please provide the :host parameter, set default_url_options[:host], 
or set :only_path to true

My last commit fixes this issue.

@blowmage blowmage merged commit fde9a17 into blowmage:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 1, 2012
  1. @vongruenigen
  2. @vongruenigen

    include #url_options method

    vongruenigen authored
    include #url_options method from https://github.com/rails/rails/blob/v3.2.8/actionpack/lib/action_dispatch/testing/integration.rb#L494
    because otherwise you have to specify a host foreach url you want to generate dynamically in an integration test
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/minitest/rails/action_dispatch.rb
View
7 lib/minitest/rails/action_dispatch.rb
@@ -16,7 +16,7 @@ class IntegrationTest < MiniTest::Rails::ActiveSupport::TestCase
def self.app
# DEPRECATE Rails application fallback
# This should be set by the initializer
- @@app || (defined?(Rails.application) && Rails.application) || nil
+ @@app || (defined?(::Rails.application) && ::Rails.application) || nil
end
def self.app=(app)
@@ -26,6 +26,11 @@ def self.app=(app)
def app
super || ::ActionDispatch::IntegrationTest.app
end
+
+ def url_options
+ reset! unless integration_session
+ integration_session.url_options
+ end
# Register by name
register_spec_type(/Acceptance ?Test\z/i, self)
Something went wrong with that request. Please try again.