29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/generators/saucy/features/features_generator.rb', line 29
def create_paths
paths = <<-PATHS
when 'the admin page'
admin_path
when 'the list of accounts'
accounts_path
when 'the list of plans page'
plans_path
when /^the memberships page for the "([^"]+)" account$/
account = Account.find_by_name!($1)
account_memberships_path(account)
when /^the projects page for the "([^"]+)" account$/
account = Account.find_by_name!($1)
account_projects_path(account)
when /settings page for the "([^"]+)" account$/i
account = Account.find_by_name!($1)
edit_account_path(account)
when /settings page$/
edit_profile_path
when /dashboard page$/
accounts_path
when /sign up page for the "([^"]+)" plan$/i
plan = Plan.find_by_name!($1)
new_plan_account_path(plan)
when /^the billing page for the "([^"]+)" account$/
account = Account.find_by_name!($1)
account_billing_path(account)
when /^the upgrade plan page for the "([^"]+)" account$/
account = Account.find_by_name!($1)
edit_account_plan_path(account)
when /^the new project page for the newest account by "([^"]*)"$/
user = User.find_by_email!($1)
account = user.accounts.order("id desc").first
new_account_project_path(account)
when /^the "([^"]*)" project page$/
project = Project.find_by_name!($1)
account_project_path(project.account, project)
when /^the new project page for the "([^"]+)" account$/
account = Account.find_by_name!($1)
new_account_project_path(account)
PATHS
replace_in_file "features/support/paths.rb",
"case page_name",
"case page_name\n#{paths}"
end
|