Note that there are some explanatory texts on larger screens.

plurals
  1. POCucumber default_url_options[:host] everytime "www.example.com" even if specified in environtemnts/test.rb
    primarykey
    data
    text
    <p>I specified the default_url_options in my environments/test.rb with</p> <pre><code>config.action_mailer.default_url_options = { :host =&gt; "www.xyu.at" } </code></pre> <p>This is quite ok and in my cucumber story, where i test registration of users, the user-activation link gets generated right</p> <pre><code>invitation_activation_url(1) =&gt; "www.xyu.at/signup/1231hj23jh23" </code></pre> <p>But when I try to follow the link provided in the email with following code in features/steps/user_steps.rb (using email-rspec from <a href="http://github.com/bmabey/email-spec/tree/master" rel="nofollow noreferrer">http://github.com/bmabey/email-spec/tree/master</a>):</p> <pre><code>When /^I follow the invitation link$/ do When 'I follow "'+invitation_activation_url(1) + '" in the email' end </code></pre> <p>Here the url gets created with the default-host:</p> <pre><code>invitation_activation_url(1) =&gt; "www.example.com/signup/1231hj23jh23" </code></pre> <p>Can anybody help me? I don't get what I'm doing wrong.... </p> <p>Thanks!</p> <p><strong>EDIT:</strong></p> <p>It seems to do with the method </p> <pre><code>current_url </code></pre> <p>but I dont know where it comes from..?</p> <p><strong>EDIT:</strong></p> <p>And I have the right environment specified in my features/support/env.rb</p> <pre><code>ENV["RAILS_ENV"] ||= "test" </code></pre> <p><strong>EDIT:</strong></p> <p>My temporary solution is, what edbond said, </p> <pre><code>invitation_activation_url(1, :host =&gt; "www.xyz.at") =&gt; "www.xyz.at/signup/1231hj23jh23" </code></pre> <p>but I dont want to name the domain explicit this way (i specified it already in my environments/test.rb file - that way it wouldnt be dry)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload