Sha256: 2cf65c46fed3e6c1cabb800f4ef8df54f80a48e21c339b9db089049f1468ac41

Contents?: true

Size: 1.54 KB

Versions: 39

Compression:

Stored size: 1.54 KB

Contents

Given /^an? "([^"]+)" account exists with a name of "([^"]*)" created (\d+) days ago$/ do |plan_name, account_name, days|
  plan = Plan.find_by_name!(plan_name)
  Factory(:account, :created_at => days.to_i.days.ago, :plan => plan, :name => account_name)
end

Given /^a "([^"]*)" account with "([^"]*)" coupon exists with a name of "([^"]*)" created (\d+) days ago$/ do |plan_name, coupon_name, account_name, days|
  plan   = Plan.find_by_name!(plan_name)
  coupon = Coupon.find_by_name!(coupon_name)
  Factory(:account, :created_at => days.to_i.days.ago, :plan => plan, :coupon => coupon, :name => account_name)
end

Given /^I sign up with the "([^"]*)" coupon for the "([^"]+)" plan$/ do |coupon_name, plan_name|
  plan = Plan.find_by_name!(plan_name)
  visit new_plan_account_path(plan, :coupon => coupon_name)
end

Given /^the "([^"]*)" account was created (\d+) days ago$/ do |account_name, days|
  Account.find_by_name!(account_name).tap do |account|
    account.created_at = days.to_i.days.ago
    account.save!
  end
end

Given /^the following limit exists for the "([^"]*)" account:$/ do |account_name, table|
  Account.find_by_name!(account_name).tap do |account|
    table.hashes.each do |limit|
      account.plan.limits.create!(limit)
    end
  end
end

When /^I follow "([^"]*)" for the "([^"]*)" account$/ do |link_text, account_name|
  account = Account.find_by_name!(account_name)
  within "##{dom_id(account)}" do
    click_link link_text
  end
end

Then /^I should see (\d+) accounts?$/ do |count|
  page.all("#user_accounts li").size.should == count.to_i
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
saucy-0.16.1 features/step_definitions/engine/account_steps.rb
saucy-0.16.0 features/step_definitions/engine/account_steps.rb
saucy-0.15.2 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.15.1 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.15.0 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.14.5 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.14.3 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.10.10 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.14.2 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.14.1 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.14.0 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.13.3 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.13.2 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.10.9 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.10.8 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.13.1 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.13.0 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.12.5 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.12.4 lib/generators/saucy/features/templates/step_definitions/account_steps.rb
saucy-0.12.3 lib/generators/saucy/features/templates/step_definitions/account_steps.rb