Skip to content

Instantly share code, notes, and snippets.

@robmerrell
Created December 4, 2009 16:08
Show Gist options
  • Save robmerrell/249107 to your computer and use it in GitHub Desktop.
Save robmerrell/249107 to your computer and use it in GitHub Desktop.
# this step creates an account with the name specified and changes the host to use the
# new subdomain generated by the account factory.
Given /^an account called "(.*)"$/ do |name|
account = Factory(:account, :name => name) # "Factory" is from factory girl
host! "#{account.cname}.local"
end
# use the step like this
Scenario: A made up scenario
Given an account called "mycompany"
And I am logged in as an administrative user
...
# just for reference, here is my account factory
Factory.define :account do |f|
f.association :subscription
f.name "testing"
f.sequence(:cname) { |n| "testcname#{n}" }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment