saasy 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/CHANGELOG.md +114 -0
  2. data/Gemfile +26 -0
  3. data/README.md +118 -0
  4. data/Rakefile +38 -0
  5. data/app/controllers/accounts_controller.rb +68 -0
  6. data/app/controllers/billings_controller.rb +25 -0
  7. data/app/controllers/invitations_controller.rb +65 -0
  8. data/app/controllers/memberships_controller.rb +45 -0
  9. data/app/controllers/plans_controller.rb +24 -0
  10. data/app/controllers/profiles_controller.rb +19 -0
  11. data/app/helpers/limits_helper.rb +13 -0
  12. data/app/mailers/billing_mailer.rb +53 -0
  13. data/app/mailers/invitation_mailer.rb +18 -0
  14. data/app/models/invitation.rb +113 -0
  15. data/app/models/limit.rb +49 -0
  16. data/app/models/membership.rb +26 -0
  17. data/app/models/permission.rb +19 -0
  18. data/app/models/signup.rb +163 -0
  19. data/app/views/accounts/_account.html.erb +9 -0
  20. data/app/views/accounts/_blank_slate.html.erb +6 -0
  21. data/app/views/accounts/_projects.html.erb +12 -0
  22. data/app/views/accounts/_subnav.html.erb +10 -0
  23. data/app/views/accounts/edit.html.erb +34 -0
  24. data/app/views/accounts/index.html.erb +9 -0
  25. data/app/views/accounts/new.html.erb +36 -0
  26. data/app/views/billing_mailer/completed_trial.text.erb +13 -0
  27. data/app/views/billing_mailer/expiring_trial.text.erb +15 -0
  28. data/app/views/billing_mailer/new_unactivated.text.erb +1 -0
  29. data/app/views/billing_mailer/problem.html.erb +13 -0
  30. data/app/views/billing_mailer/problem.text.erb +14 -0
  31. data/app/views/billing_mailer/receipt.html.erb +41 -0
  32. data/app/views/billing_mailer/receipt.text.erb +25 -0
  33. data/app/views/billings/_form.html.erb +8 -0
  34. data/app/views/billings/edit.html.erb +13 -0
  35. data/app/views/billings/show.html.erb +29 -0
  36. data/app/views/invitation_mailer/invitation.text.erb +6 -0
  37. data/app/views/invitations/new.html.erb +17 -0
  38. data/app/views/invitations/show.html.erb +22 -0
  39. data/app/views/layouts/saucy.html.erb +36 -0
  40. data/app/views/limits/_meter.html.erb +13 -0
  41. data/app/views/memberships/edit.html.erb +21 -0
  42. data/app/views/memberships/index.html.erb +17 -0
  43. data/app/views/plans/_plan.html.erb +32 -0
  44. data/app/views/plans/_terms.html.erb +15 -0
  45. data/app/views/plans/edit.html.erb +33 -0
  46. data/app/views/plans/index.html.erb +12 -0
  47. data/app/views/profiles/_inputs.html.erb +5 -0
  48. data/app/views/profiles/edit.html.erb +36 -0
  49. data/app/views/projects/_form.html.erb +36 -0
  50. data/app/views/projects/edit.html.erb +22 -0
  51. data/app/views/projects/index.html.erb +28 -0
  52. data/app/views/projects/new.html.erb +13 -0
  53. data/app/views/projects/show.html.erb +0 -0
  54. data/app/views/shared/_project_dropdown.html.erb +55 -0
  55. data/app/views/shared/_saucy_javascript.html.erb +33 -0
  56. data/config/locales/en.yml +37 -0
  57. data/config/routes.rb +19 -0
  58. data/features/run_features.feature +83 -0
  59. data/features/step_definitions/clearance_steps.rb +45 -0
  60. data/features/step_definitions/rails_steps.rb +73 -0
  61. data/features/step_definitions/saucy_steps.rb +8 -0
  62. data/features/support/env.rb +4 -0
  63. data/features/support/file.rb +11 -0
  64. data/lib/generators/saucy/base.rb +18 -0
  65. data/lib/generators/saucy/features/features_generator.rb +91 -0
  66. data/lib/generators/saucy/features/templates/README +3 -0
  67. data/lib/generators/saucy/features/templates/factories.rb +71 -0
  68. data/lib/generators/saucy/features/templates/features/edit_profile.feature +9 -0
  69. data/lib/generators/saucy/features/templates/features/edit_project_permissions.feature +37 -0
  70. data/lib/generators/saucy/features/templates/features/edit_user_permissions.feature +47 -0
  71. data/lib/generators/saucy/features/templates/features/manage_account.feature +35 -0
  72. data/lib/generators/saucy/features/templates/features/manage_billing.feature +93 -0
  73. data/lib/generators/saucy/features/templates/features/manage_plan.feature +143 -0
  74. data/lib/generators/saucy/features/templates/features/manage_projects.feature +139 -0
  75. data/lib/generators/saucy/features/templates/features/manage_users.feature +142 -0
  76. data/lib/generators/saucy/features/templates/features/new_account.feature +33 -0
  77. data/lib/generators/saucy/features/templates/features/project_dropdown.feature +77 -0
  78. data/lib/generators/saucy/features/templates/features/sign_up.feature +32 -0
  79. data/lib/generators/saucy/features/templates/features/sign_up_paid.feature +65 -0
  80. data/lib/generators/saucy/features/templates/features/trial_plans.feature +82 -0
  81. data/lib/generators/saucy/features/templates/step_definitions/account_steps.rb +30 -0
  82. data/lib/generators/saucy/features/templates/step_definitions/braintree_steps.rb +25 -0
  83. data/lib/generators/saucy/features/templates/step_definitions/cron_steps.rb +23 -0
  84. data/lib/generators/saucy/features/templates/step_definitions/email_steps.rb +40 -0
  85. data/lib/generators/saucy/features/templates/step_definitions/factory_girl_steps.rb +1 -0
  86. data/lib/generators/saucy/features/templates/step_definitions/html_steps.rb +51 -0
  87. data/lib/generators/saucy/features/templates/step_definitions/plan_steps.rb +16 -0
  88. data/lib/generators/saucy/features/templates/step_definitions/project_steps.rb +4 -0
  89. data/lib/generators/saucy/features/templates/step_definitions/session_steps.rb +37 -0
  90. data/lib/generators/saucy/features/templates/step_definitions/user_steps.rb +100 -0
  91. data/lib/generators/saucy/features/templates/support/braintree.rb +5 -0
  92. data/lib/generators/saucy/install/install_generator.rb +40 -0
  93. data/lib/generators/saucy/install/templates/controllers/projects_controller.rb +3 -0
  94. data/lib/generators/saucy/install/templates/create_saucy_tables.rb +115 -0
  95. data/lib/generators/saucy/install/templates/models/account.rb +3 -0
  96. data/lib/generators/saucy/install/templates/models/plan.rb +3 -0
  97. data/lib/generators/saucy/install/templates/models/project.rb +3 -0
  98. data/lib/generators/saucy/specs/specs_generator.rb +20 -0
  99. data/lib/generators/saucy/specs/templates/support/braintree.rb +5 -0
  100. data/lib/generators/saucy/views/views_generator.rb +23 -0
  101. data/lib/saucy.rb +10 -0
  102. data/lib/saucy/account.rb +132 -0
  103. data/lib/saucy/account_authorization.rb +67 -0
  104. data/lib/saucy/configuration.rb +29 -0
  105. data/lib/saucy/engine.rb +35 -0
  106. data/lib/saucy/fake_braintree.rb +134 -0
  107. data/lib/saucy/layouts.rb +36 -0
  108. data/lib/saucy/plan.rb +54 -0
  109. data/lib/saucy/project.rb +125 -0
  110. data/lib/saucy/projects_controller.rb +94 -0
  111. data/lib/saucy/railties/tasks.rake +28 -0
  112. data/lib/saucy/routing_extensions.rb +121 -0
  113. data/lib/saucy/subscription.rb +237 -0
  114. data/lib/saucy/user.rb +30 -0
  115. data/spec/controllers/accounts_controller_spec.rb +228 -0
  116. data/spec/controllers/application_controller_spec.rb +32 -0
  117. data/spec/controllers/invitations_controller_spec.rb +215 -0
  118. data/spec/controllers/memberships_controller_spec.rb +117 -0
  119. data/spec/controllers/plans_controller_spec.rb +13 -0
  120. data/spec/controllers/profiles_controller_spec.rb +48 -0
  121. data/spec/controllers/projects_controller_spec.rb +216 -0
  122. data/spec/environment.rb +95 -0
  123. data/spec/layouts_spec.rb +21 -0
  124. data/spec/mailers/billing_mailer_spec.rb +68 -0
  125. data/spec/mailers/invitiation_mailer_spec.rb +19 -0
  126. data/spec/models/account_spec.rb +218 -0
  127. data/spec/models/invitation_spec.rb +320 -0
  128. data/spec/models/limit_spec.rb +70 -0
  129. data/spec/models/membership_spec.rb +37 -0
  130. data/spec/models/permission_spec.rb +30 -0
  131. data/spec/models/plan_spec.rb +81 -0
  132. data/spec/models/project_spec.rb +223 -0
  133. data/spec/models/signup_spec.rb +177 -0
  134. data/spec/models/subscription_spec.rb +481 -0
  135. data/spec/models/user_spec.rb +72 -0
  136. data/spec/route_extensions_spec.rb +51 -0
  137. data/spec/saucy_spec.rb +62 -0
  138. data/spec/scaffold/config/routes.rb +5 -0
  139. data/spec/spec_helper.rb +39 -0
  140. data/spec/support/authentication_helpers.rb +81 -0
  141. data/spec/support/authorization_helpers.rb +56 -0
  142. data/spec/support/braintree.rb +7 -0
  143. data/spec/support/clearance_matchers.rb +55 -0
  144. data/spec/support/notifications.rb +57 -0
  145. data/spec/views/accounts/_account.html.erb_spec.rb +37 -0
  146. metadata +325 -0
@@ -0,0 +1,32 @@
1
+ <p class="name"><%= plan.name %></p>
2
+ <p class="price">
3
+ <% if plan.billed? %>
4
+ $<%= plan.price %>/month
5
+ <% else %>
6
+ Free
7
+ <% end %>
8
+ <% if plan.trial? %>
9
+ Trial
10
+ <% end -%>
11
+ </p>
12
+ <ul class="features">
13
+ <% if plan.trial? -%>
14
+ <li class="trial"><%= t(".trial_will_expire",
15
+ :default => "Your trial will expire after 30 days.") %></li>
16
+ <% else -%>
17
+ <% plan.limits.numbered.each do |limit| %>
18
+ <%= content_tag_for :li, limit, :class => limit.name do %>
19
+ <%= pluralize(limit.value, limit.name.singularize) %>
20
+ <% end %>
21
+ <% end %>
22
+ <% plan.limits.boolean.each do |limit| %>
23
+ <%= content_tag_for :li, limit, :class => limit.name do %>
24
+ <% if limit.allowed? -%>
25
+ <%= limit.name %>
26
+ <% else %>
27
+ &nbsp;
28
+ <% end -%>
29
+ <% end -%>
30
+ <% end %>
31
+ <% end -%>
32
+ </ul>
@@ -0,0 +1,15 @@
1
+ <ul class="terms">
2
+ <li>
3
+ <h3>Monthly Plans</h3>
4
+ <p>All paid plans work on a monthly billing cycle, and the prices shown on this page reflect the monthly costs of using the service.</p>
5
+ </li>
6
+ <li>
7
+ <h3>Upgrade or Downgrade Anytime</h3>
8
+ <p>Once you signup you can upgrade, downgrade, or cancel your account at any time. The new charge will take effect on your next billing. If you cancel your account, we'll never bill you again. We don't pro-rate partial months, and we cannot issue refunds for partial or previous months.</p>
9
+ </li>
10
+ <li>
11
+ <h3>Questions?</h3>
12
+ <p>Have questions about plans or billing? <%= link_to "Get in touch", "http://help.#{request.domain}" %>!</p>
13
+ </li>
14
+ </ul>
15
+
@@ -0,0 +1,33 @@
1
+ <%= content_for :header do -%>
2
+ <h2>Upgrade Your Plan</h2>
3
+ <% end -%>
4
+
5
+ <%= semantic_form_for @account, :url => account_plan_path(@account) do |form| %>
6
+ <%= form.inputs :class => "radio optional" do %>
7
+ <% @plans.each do |plan| -%>
8
+ <%= content_tag_for :li, plan, :class => "#{plan.name.parameterize} #{'disabled' if !@account.can_change_plan_to?(plan)}" do %>
9
+ <div>
10
+ <%= render(plan) %>
11
+ </div>
12
+ <%= form.label :plan_id, "Choose plan", :value => plan.id %>
13
+ <%= form.radio_button :plan_id, plan.id, :disabled => !@account.can_change_plan_to?(plan), "data-free" => plan.free? %>
14
+ <% if !@account.can_change_plan_to?(plan) -%>
15
+ <p class="disabled"><%= t(".plan-disabled", :default => "Too big for %{name}.", :name => plan.name) %></p>
16
+ <% end -%>
17
+ <% end %>
18
+ <% end -%>
19
+ <% end %>
20
+
21
+ <% if !@account.credit_card -%>
22
+ <div class="billing_information" style="<%= 'display: none' if @account.plan.free? %>">
23
+ <h5 class="legend">Billing Information</h5>
24
+ <%= render :partial => 'billings/form', :locals => { :form => form } %>
25
+ </div>
26
+ <% end -%>
27
+
28
+ <%= form.buttons do %>
29
+ <%= form.commit_button "Upgrade" %>
30
+ <% end %>
31
+ <% end %>
32
+
33
+ <%= render :partial => "shared/saucy_javascript" %>
@@ -0,0 +1,12 @@
1
+ <ol>
2
+ <% @plans.each do |plan| %>
3
+ <%= content_tag_for :li, plan, :class => plan.name.parameterize do %>
4
+ <%= link_to new_plan_account_path(plan) do -%>
5
+ <%= render(plan) %>
6
+ <% end -%>
7
+ <% end %>
8
+ <% end %>
9
+ </ol>
10
+
11
+ <%= render 'plans/terms' %>
12
+
@@ -0,0 +1,5 @@
1
+ <%= form.inputs do %>
2
+ <%= form.input :email %>
3
+ <%= form.input :password %>
4
+ <% end %>
5
+
@@ -0,0 +1,36 @@
1
+ <% content_for :header do -%>
2
+ <h2>User Details</h2>
3
+ <% end -%>
4
+
5
+ <div id="user_accounts">
6
+ <h3>Accounts</h3>
7
+ <ul>
8
+ <% @user.accounts.each do |account| -%>
9
+ <li>
10
+ <%= link_to edit_account_path(account) do -%>
11
+ <h4><%= account.name %></h4>
12
+ <p class="edit-account">edit account</p>
13
+ <% end -%>
14
+ </li>
15
+ <% end -%>
16
+ </ul>
17
+ <%= link_to 'Add new account', plans_path, :class => 'new-account' %>
18
+ </div>
19
+
20
+
21
+ <div id="login_info"><h3>Login Information</h3>
22
+ <%= semantic_form_for @user, :url => profile_path do |form| %>
23
+ <%= form.inputs do %>
24
+ <%= form.input :name %>
25
+ <%= form.input :email %>
26
+ <% end %>
27
+
28
+ <%= form.inputs do %>
29
+ <%= form.input :password, :label => "New password", :required => true %>
30
+ <% end %>
31
+
32
+ <%= form.buttons do %>
33
+ <%= form.commit_button "Update" %>
34
+ <% end %>
35
+ <% end %>
36
+ </div>
@@ -0,0 +1,36 @@
1
+ <%= form.inputs do %>
2
+ <% if current_user.memberships.admin.size > 1 -%>
3
+ <%= form.input :account, :collection => current_user.memberships.admin.collect(&:account) %>
4
+ <% else %>
5
+ <%= form.input :account, :as => :hidden, :value => current_account.id %>
6
+ <% end -%>
7
+ <%= form.input :name, :hint => project_url(form.object).html_safe %>
8
+ <%= form.input :keyword, :wrapper_html => { :style => 'display: none' } %>
9
+ <% if form.object.persisted? -%>
10
+ <%= form.input :archived, :hint => t('project.archived.hint', :default => "Archived project don't count against your project total. You cannot create or edit stories or discussions.") %>
11
+ <% end -%>
12
+ <%= form.input :users, :label => "Admins",
13
+ :as => :check_boxes,
14
+ :collection => form.object.account.admins,
15
+ :wrapper_html => { :id => "project_admins_input" },
16
+ :input_html => { :disabled => true } %>
17
+ <% if form.object.account.non_admins.any? -%>
18
+ <%= form.input :users, :as => :check_boxes, :collection => form.object.account.non_admins %>
19
+ <% end -%>
20
+ <% end %>
21
+
22
+ <%= content_for :javascript do -%>
23
+ <%= javascript_tag do %>
24
+ $(function() {
25
+ $('#project_account_id').change(function() {
26
+ if($('#project_account_id').val() != "") {
27
+ console.log(window.location);
28
+ window.location.href = window.location.pathname + '?project[account_id]=' + $('#project_account_id').val();
29
+ return false;
30
+ }
31
+ });
32
+ });
33
+ <% end %>
34
+ <% end -%>
35
+
36
+ <%= render :partial => "shared/saucy_javascript" %>
@@ -0,0 +1,22 @@
1
+ <% content_for :header do -%>
2
+ <h2>Edit project: <%= @project.name %></h2>
3
+ <% end -%>
4
+
5
+ <div class="actions">
6
+ <%= link_to project_path(@project), :method => 'delete', :confirm => 'Are you sure you want to delete this project and all associated content?', :class => 'action' do %>
7
+ <span class="delete_item">Remove this project</span>
8
+ <% end -%>
9
+ </div>
10
+
11
+
12
+ <%= render :partial => 'accounts/subnav' %>
13
+
14
+ <%= semantic_form_for @project, :url => account_project_url(current_account, @project) do |form| %>
15
+ <%= render 'form', :form => form %>
16
+
17
+ <%= form.buttons do %>
18
+ <%= form.commit_button %>
19
+ <%= link_to 'Cancel', account_projects_path(current_account) %>
20
+ <% end %>
21
+ <% end -%>
22
+
@@ -0,0 +1,28 @@
1
+ <% content_for :header do -%>
2
+ <h2>Projects for <%= current_account.name %></h2>
3
+ <% end -%>
4
+
5
+ <%= render :partial => 'accounts/subnav' %>
6
+
7
+ <h3>Active Projects</h3>
8
+ <ul class="projects active">
9
+ <% @active_projects.each do |project| -%>
10
+ <%= content_tag_for :li, project do -%>
11
+ <%= link_to h(project.name), edit_project_path(project), :class => "edit" %>
12
+ <% end -%>
13
+ <% end -%>
14
+ </ul>
15
+
16
+ <%= link_to 'New Project', new_account_project_path(current_account), :class => "button" %>
17
+
18
+ <% if @archived_projects.any? -%>
19
+ <h3>Archived Projects</h3>
20
+ <ul class="projects archived">
21
+ <% @archived_projects.each do |project| -%>
22
+ <%= content_tag_for :li, project do -%>
23
+ <%= link_to h(project.name), edit_project_path(project), :class => "edit" %>
24
+ <%= link_to "View Project", project_path(project), :class => "view" %>
25
+ <% end -%>
26
+ <% end -%>
27
+ </ul>
28
+ <% end -%>
@@ -0,0 +1,13 @@
1
+ <% content_for :header do -%>
2
+ <h2>Create a new project</h2>
3
+ <% end -%>
4
+
5
+ <%= render :partial => 'accounts/subnav' %>
6
+
7
+ <%= semantic_form_for(@project, :url => account_projects_url(current_account)) do |form| %>
8
+ <%= render 'form', :form => form %>
9
+ <%= form.buttons do -%>
10
+ <%= form.commit_button %>
11
+ <li><%= link_to 'Cancel', account_projects_path(current_account) %></li>
12
+ <% end -%>
13
+ <% end -%>
File without changes
@@ -0,0 +1,55 @@
1
+ <% if current_user.projects.active.any? -%>
2
+ <ul id="project-selection">
3
+ <li>
4
+ <h1>
5
+ <%= link_to current_project? ? project_path(current_project) : root_url do -%>
6
+ <% if current_project? -%>
7
+ <span><%= current_project.name %></span>
8
+ <% else %>
9
+ <span>Projects</span>
10
+ <% end -%>
11
+ <% if current_user.memberships.admin.any? || current_user.projects.active.any? -%>
12
+ <img src="/images/arrow-down.png" alt="arrow down" />
13
+ <% end -%>
14
+ <% end %>
15
+ </h1>
16
+ <ul>
17
+ <% current_user.projects.active.each do |project| %>
18
+ <li><%= link_to project.name, project_path(project) -%></li>
19
+ <% end %>
20
+ <% if current_user.memberships.admin.any? -%>
21
+ <li>
22
+ <%= link_to current_account? && current_user.admin_of?(current_account) ? new_project_path(current_account) : new_project_path(current_user.memberships.admin.first.account) do %>
23
+ &#43; Create a new project
24
+ <% end %>
25
+ </li>
26
+ <% end -%>
27
+ </ul>
28
+ </li>
29
+ </ul>
30
+ <% end -%>
31
+
32
+ <%= content_for :javascript do -%>
33
+ <%= javascript_tag do %>
34
+ $(function() {
35
+ $('#project-selection h1 a').click(function() {
36
+ var dropdownbutton = $('#project-selection h1 a');
37
+ var dropdownlist = $('#project-selection li ul');
38
+ if(dropdownbutton.hasClass("expanded")) {
39
+ dropdownbutton.removeClass("expanded");
40
+ dropdownlist.removeClass("expanded");
41
+ } else {
42
+ dropdownbutton.addClass("expanded");
43
+ dropdownlist.addClass("expanded");
44
+ }
45
+ return false;
46
+ });
47
+
48
+ $('html *').live('click', function() {
49
+ if($(this).parents('.expanded').length == 0) {
50
+ $('.expanded').removeClass('expanded');
51
+ }
52
+ });
53
+ });
54
+ <% end %>
55
+ <% end -%>
@@ -0,0 +1,33 @@
1
+ <%= content_for :javascript do -%>
2
+ <%= javascript_tag do %>
3
+ $(function() {
4
+ $('#project_name_input p.inline-hints').each(function(index) {
5
+ $(this).html($(this).text().replace("keyword", "<span>keyword</span>"))
6
+ });
7
+ $('#project_name').keyup(function(){
8
+ var mainPart = /^([\w\s]*)(\W*)/.exec($(this).val())[1];
9
+ mainPart = mainPart.replace(/ /g, "").toLowerCase();
10
+ if(mainPart == "") mainPart = "keyword";
11
+ $(this).siblings('p.inline-hints').find('span').text(mainPart);
12
+ $('#project_keyword').val(mainPart);
13
+ });
14
+
15
+ $.fn.updateSelectedPlan = function() {
16
+ $(".plans-edit input:radio:not(checked)").each(function() {
17
+ $("label[for=" + $(this).attr("id") + "]").removeClass('selected');
18
+ });
19
+ $("label[for=" + $(this).attr("id") + "]").addClass('selected');
20
+ if($(this).attr("data-free") == "true") {
21
+ $(".billing_information").hide();
22
+ } else {
23
+ $(".billing_information").show();
24
+ }
25
+ };
26
+
27
+ $(".plans-edit input:radio").click(function() {
28
+ $(this).updateSelectedPlan();
29
+ });
30
+ $(".plans-edit input:radio:checked").updateSelectedPlan();
31
+ });
32
+ <% end %>
33
+ <% end -%>
@@ -0,0 +1,37 @@
1
+ en:
2
+ app_name: App Name
3
+ app_url: 'http://example.com'
4
+ support_email: support@example.com
5
+ saucy:
6
+ billing_address: Billing Address
7
+ errors:
8
+ past_due:
9
+ admin: There was an issue processing the credit card you have on file. Please update your credit card information.
10
+ user: There was an issue processing the credit card on file for this account. Please have an administrator on the account update the credit card information.
11
+ expired:
12
+ admin: Your account's trial has expired. Please upgrade to another plan.
13
+ user: This account's trial has expired. Please have an administrator on the account upgrade to another plan.
14
+ billing_mailer:
15
+ expiring_trial:
16
+ greeting: Thanks for giving us a try!
17
+ expiration_notice: "Your 30 day trial for %{account_name} is expiring soon. I hope that you've enjoyed %{app_name} enough to sign up for a paid subscription. If you'd like to continue using your account, please take a moment to choose a paid plan:"
18
+ contact: "If you need more time to evaluate %{app_name} or you have any questions, please don't hesitate to contact me."
19
+ completed_trial:
20
+ greeting: Thanks for giving us a try!
21
+ notice: "Your 30 day trial for %{account_name} is over, and your account has become inactive. If you'd like to continue using your account, please take a moment to choose a paid plan:"
22
+ contact: "If you need more time to evaluate %{app_name} or you have any questions, please don't hesitate to contact me."
23
+ new_unactivated:
24
+ body: |-
25
+ Hi,
26
+
27
+ I noticed that you started to try out %{app_name}, but you haven't set up any projects yet.
28
+
29
+ You can setup a new project by visiting
30
+ %{new_project_url}
31
+
32
+ If you have any questions or need any help getting your %{app_name} account set up, feel free to respond to this email.
33
+
34
+ Thanks,
35
+
36
+ The %{app_name} Team
37
+
@@ -0,0 +1,19 @@
1
+ require 'saucy/routing_extensions'
2
+
3
+ Rails.application.routes.draw do
4
+ resources :accounts, :only => [:index, :edit, :update, :destroy]
5
+
6
+ through :accounts do
7
+ resource :billing
8
+ resource :plan
9
+ resources :projects
10
+ resources :memberships, :only => [:index, :edit, :update, :destroy]
11
+ resources :invitations, :only => [:show, :update, :new, :create]
12
+ end
13
+
14
+ resources :plans, :only => [:index] do
15
+ resources :accounts, :only => [:new, :create]
16
+ end
17
+
18
+ resource :profile, :only => [:edit, :update]
19
+ end
@@ -0,0 +1,83 @@
1
+ @disable-bundler @puts @announce
2
+ Feature: generate a saucy application and run rake
3
+
4
+ Background:
5
+ When I successfully run "bundle exec rails new testapp"
6
+ And I cd to "testapp"
7
+ And I copy the locked Gemfile from this project
8
+ And I append to "Gemfile" with:
9
+ """
10
+ gem "clearance", :git => "git://github.com/thoughtbot/clearance.git"
11
+ gem "cucumber-rails"
12
+ gem "capybara"
13
+ gem "factory_girl_rails"
14
+ gem "dynamic_form"
15
+ gem "database_cleaner"
16
+ gem "formtastic"
17
+ gem "rspec-rails"
18
+ gem "bourne"
19
+ gem "shoulda"
20
+ gem "launchy"
21
+ gem "timecop"
22
+ gem "jquery-rails"
23
+ """
24
+ When I add the "saucy" gem from this project as a dependency
25
+ And I successfully run "bundle install --local"
26
+ And I successfully run "rails generate jquery:install --force"
27
+ And I bootstrap the application for clearance
28
+ And I bootstrap the application for saucy
29
+
30
+ Scenario: generate a saucy application and run rake
31
+ When I successfully run "rails generate saucy:install"
32
+ And I successfully run "rails generate saucy:specs"
33
+ And I successfully run "rails generate saucy:features"
34
+ And I successfully run "rake db:migrate"
35
+ And I run "rake"
36
+ Then it should pass with:
37
+ """
38
+ passed
39
+ """
40
+ Then the output should not contain "failed"
41
+ And the output should not contain "Could not find generator"
42
+
43
+ Scenario: A new saucy app with custom views
44
+ When I successfully run "rails generate saucy:install"
45
+ And I successfully run "rails generate saucy:specs"
46
+ And I successfully run "rails generate saucy:features"
47
+ And I successfully run "rails generate saucy:views"
48
+ And I successfully run "rake db:migrate"
49
+ And I give a more detailed new account message
50
+ And I run "rake"
51
+ Then it should pass with:
52
+ """
53
+ passed
54
+ """
55
+ Then the output should not contain "failed"
56
+ And the output should not contain "Could not find generator"
57
+
58
+ Scenario: A new saucy app with custom layouts
59
+ When I successfully run "rails generate saucy:install"
60
+ And I successfully run "rails generate saucy:specs"
61
+ And I successfully run "rails generate saucy:features"
62
+ And I successfully run "rake db:migrate"
63
+ And I add a custom layout to the accounts index
64
+ And I run "rake"
65
+ Then it should pass with:
66
+ """
67
+ passed
68
+ """
69
+ Then the output should not contain "failed"
70
+ And the output should not contain "Could not find generator"
71
+
72
+ Scenario: run specs
73
+ When I successfully run "rails generate saucy:install"
74
+ And I successfully run "rails generate saucy:specs"
75
+ And I successfully run "rails generate saucy:features"
76
+ And I successfully run "rake db:migrate"
77
+ And I copy the specs for this project
78
+ And I run "rake spec"
79
+ Then it should pass with:
80
+ """
81
+ 0 failures
82
+ """
83
+ Then at least one example should have run