Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I am looking to do something very similar. I thought about adding an additional pow directory for test, then using the pow directives to override the environment. I think this is done within a ".powenv" inside your app directory. Here is an example of a quick fix:</p> <pre><code>echo export RAILS_ENV=cucumber &gt; .powenv &amp;&amp; touch tmp/restart.txt </code></pre> <p>But it would be better to do something dynamic so that before you start the test, you can tell pow what env to run, then when finished switch back, maybe even run the test server on a different port on a temp basis. Pow is the only great solution I know of so far for handeling subdomains.</p> <p><strong>EDITED:</strong> I have this working now in my environment with the following addition to my <strong><em>features/support/env.rb</em></strong> file.</p> <pre><code># Switch Pow to For Cucumber Tests Capybara.default_driver = :selenium # Subdomain testing will only work with pow and selenium pow_config = "#{Rails.root}/.powenv" # Dont change, this is the Config Files Location. pow_config_stash = "#{Rails.root}/.powenv_original" # This is what the config will be stashed as during testing. Before do # Set the default host Capybara.app_host = "http://www.resipsa.dev" # Stash the existing config File.rename(pow_config,pow_config_stash) if File.exists? pow_config # Write the new pow config f = File.new("#{Rails.root}/.powenv", "w") f.write "export RAILS_ENV=test" f.close # Touch tmp/restart.txt to force a restart FileUtils.touch "#{Rails.root}/tmp/restart.txt" end After do # Delete the temp config File.delete(pow_config) # Restore the Original Config File.rename(pow_config_stash,pow_config) if File.exists? pow_config_stash # Touch tmp/restart.txt to force a restart FileUtils.touch "#{Rails.root}/tmp/restart.txt" end </code></pre>
 

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