saucy 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +17 -0
- data/app/controllers/accounts_controller.rb +1 -1
- data/lib/generators/saucy/features/features_generator.rb +4 -0
- data/lib/generators/saucy/features/templates/features/manage_account.feature +2 -1
- data/lib/generators/saucy/features/templates/features/sign_up.feature +2 -1
- data/spec/controllers/accounts_controller_spec.rb +15 -0
- metadata +76 -76
data/README
CHANGED
@@ -2,11 +2,13 @@ script/rails g saucy:install
|
|
2
2
|
script/rails g saucy:features
|
3
3
|
script/rails g saucy:views
|
4
4
|
|
5
|
+
|
5
6
|
To change the layout for a controller inside of saucy, add a line like this to
|
6
7
|
your config/application.rb:
|
7
8
|
|
8
9
|
config.saucy.layouts.accounts.index = "custom"
|
9
10
|
|
11
|
+
|
10
12
|
To extend the ProjectsController:
|
11
13
|
|
12
14
|
class ProjectsController < ApplicationController
|
@@ -17,3 +19,18 @@ To extend the ProjectsController:
|
|
17
19
|
@deleters = @project.deleters
|
18
20
|
end
|
19
21
|
end
|
22
|
+
|
23
|
+
|
24
|
+
Plans need to exist for users to sign up for. In db/seeds.rb:
|
25
|
+
|
26
|
+
%w(free expensive mega-expensive).each do |plan_name|
|
27
|
+
Plan.find_or_create_by_name(plan_name)
|
28
|
+
end
|
29
|
+
|
30
|
+
Then run: rake db:seed
|
31
|
+
|
32
|
+
To use the seed data in your Cucumber:
|
33
|
+
|
34
|
+
features/support/seed.rb:
|
35
|
+
|
36
|
+
require Rails.root.join('db','seeds')
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class AccountsController < ApplicationController
|
2
|
-
|
2
|
+
before_filter :authenticate, :only => [:index, :edit, :update]
|
3
3
|
before_filter :authorize_admin, :except => [:new, :create, :index]
|
4
4
|
layout Saucy::Layouts.to_proc
|
5
5
|
|
@@ -27,6 +27,10 @@ DESC
|
|
27
27
|
|
28
28
|
def create_paths
|
29
29
|
paths = <<-PATHS
|
30
|
+
when 'the list of accounts'
|
31
|
+
accounts_path
|
32
|
+
when 'the list of plans page'
|
33
|
+
plans_path
|
30
34
|
when /^the memberships page for the "([^"]+)" account$/
|
31
35
|
account = Account.find_by_name!($1)
|
32
36
|
account_memberships_path(account)
|
@@ -6,7 +6,8 @@ Feature: Manage account
|
|
6
6
|
Scenario: Edit account details
|
7
7
|
Given an account exists with a name of "Test"
|
8
8
|
And I am signed in as an admin of the "Test" account
|
9
|
-
When I go to the
|
9
|
+
When I go to the list of accounts
|
10
|
+
And I follow "Settings" within ".account-header"
|
10
11
|
Then I should see "Settings for Test"
|
11
12
|
When I fill in "Account name" with "Name Change"
|
12
13
|
And I press "Update"
|
@@ -15,7 +15,8 @@ Feature: Sign up
|
|
15
15
|
Then I should see error messages
|
16
16
|
|
17
17
|
Scenario: User signs up with valid data
|
18
|
-
When I go to the
|
18
|
+
When I go to the list of plans page
|
19
|
+
And I follow "Free"
|
19
20
|
And I fill in "Email" with "email@person.com"
|
20
21
|
And I fill in "Password" with "password"
|
21
22
|
And I fill in "Confirm password" with "password"
|
@@ -136,6 +136,21 @@ describe AccountsController, "index with multiple projects" do
|
|
136
136
|
end
|
137
137
|
end
|
138
138
|
|
139
|
+
describe AccountsController, "signed out" do
|
140
|
+
it "redirects to sign_in on index" do
|
141
|
+
get :index
|
142
|
+
should redirect_to(sign_in_path)
|
143
|
+
end
|
144
|
+
it "redirects to sign_in on edit" do
|
145
|
+
get :edit, :id => 1
|
146
|
+
should redirect_to(sign_in_path)
|
147
|
+
end
|
148
|
+
it "redirects to sign_in on update" do
|
149
|
+
put :update, :id => 1, :account => {}
|
150
|
+
should redirect_to(sign_in_path)
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
139
154
|
describe AccountsController, "index with one project" do
|
140
155
|
let(:user) { Factory.stub(:user) }
|
141
156
|
let(:accounts) { %w(one two) }
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saucy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 7
|
10
|
+
version: 0.1.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- thoughtbot, inc.
|
@@ -17,14 +17,13 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-12-
|
20
|
+
date: 2010-12-20 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
|
-
type: :runtime
|
25
|
-
prerelease: false
|
26
24
|
name: formtastic
|
27
|
-
|
25
|
+
prerelease: false
|
26
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
28
27
|
none: false
|
29
28
|
requirements:
|
30
29
|
- - ">="
|
@@ -34,12 +33,12 @@ dependencies:
|
|
34
33
|
- 1
|
35
34
|
- 2
|
36
35
|
version: "1.2"
|
37
|
-
requirement: *id001
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
36
|
type: :runtime
|
40
|
-
|
37
|
+
version_requirements: *id001
|
38
|
+
- !ruby/object:Gem::Dependency
|
41
39
|
name: railties
|
42
|
-
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
43
42
|
none: false
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
@@ -50,12 +49,12 @@ dependencies:
|
|
50
49
|
- 0
|
51
50
|
- 3
|
52
51
|
version: 3.0.3
|
53
|
-
|
52
|
+
type: :runtime
|
53
|
+
version_requirements: *id002
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
type: :development
|
56
|
-
prerelease: false
|
57
55
|
name: aruba
|
58
|
-
|
56
|
+
prerelease: false
|
57
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
58
|
none: false
|
60
59
|
requirements:
|
61
60
|
- - "="
|
@@ -66,7 +65,8 @@ dependencies:
|
|
66
65
|
- 2
|
67
66
|
- 6
|
68
67
|
version: 0.2.6
|
69
|
-
|
68
|
+
type: :development
|
69
|
+
version_requirements: *id003
|
70
70
|
description: Clearance-based Rails engine for Software as a Service (Saas) that provides account and project management
|
71
71
|
email: support@thoughtbot.com
|
72
72
|
executables: []
|
@@ -76,102 +76,102 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
|
78
78
|
files:
|
79
|
-
- Gemfile
|
80
79
|
- Gemfile.lock
|
81
80
|
- Rakefile
|
82
81
|
- README
|
82
|
+
- Gemfile
|
83
83
|
- config/routes.rb
|
84
|
-
- app/
|
85
|
-
- app/
|
86
|
-
- app/
|
87
|
-
- app/controllers/plans_controller.rb
|
88
|
-
- app/controllers/profiles_controller.rb
|
89
|
-
- app/models/invitation.rb
|
90
|
-
- app/models/membership.rb
|
91
|
-
- app/models/permission.rb
|
92
|
-
- app/models/signup.rb
|
93
|
-
- app/views/accounts/_account.html.erb
|
94
|
-
- app/views/accounts/_blank_slate.html.erb
|
84
|
+
- app/views/invitations/new.html.erb
|
85
|
+
- app/views/invitations/show.html.erb
|
86
|
+
- app/views/accounts/new.html.erb
|
95
87
|
- app/views/accounts/_projects.html.erb
|
96
|
-
- app/views/accounts/_tab_bar.html.erb
|
97
88
|
- app/views/accounts/edit.html.erb
|
89
|
+
- app/views/accounts/_tab_bar.html.erb
|
90
|
+
- app/views/accounts/_blank_slate.html.erb
|
91
|
+
- app/views/accounts/_account.html.erb
|
98
92
|
- app/views/accounts/index.html.erb
|
99
|
-
- app/views/accounts/new.html.erb
|
100
93
|
- app/views/invitation_mailer/invitation.text.erb
|
101
|
-
- app/views/
|
102
|
-
- app/views/invitations/show.html.erb
|
94
|
+
- app/views/plans/index.html.erb
|
103
95
|
- app/views/memberships/edit.html.erb
|
104
96
|
- app/views/memberships/index.html.erb
|
105
|
-
- app/views/plans/index.html.erb
|
106
|
-
- app/views/profiles/_inputs.html.erb
|
107
97
|
- app/views/profiles/edit.html.erb
|
108
|
-
- app/views/
|
98
|
+
- app/views/profiles/_inputs.html.erb
|
99
|
+
- app/views/projects/new.html.erb
|
109
100
|
- app/views/projects/edit.html.erb
|
110
101
|
- app/views/projects/index.html.erb
|
111
|
-
- app/views/projects/
|
102
|
+
- app/views/projects/_form.html.erb
|
103
|
+
- app/controllers/profiles_controller.rb
|
104
|
+
- app/controllers/accounts_controller.rb
|
105
|
+
- app/controllers/memberships_controller.rb
|
106
|
+
- app/controllers/plans_controller.rb
|
107
|
+
- app/controllers/invitations_controller.rb
|
108
|
+
- app/models/membership.rb
|
109
|
+
- app/models/invitation.rb
|
110
|
+
- app/models/signup.rb
|
111
|
+
- app/models/permission.rb
|
112
|
+
- lib/generators/saucy/views/views_generator.rb
|
112
113
|
- lib/generators/saucy/base.rb
|
114
|
+
- lib/generators/saucy/install/install_generator.rb
|
115
|
+
- lib/generators/saucy/install/templates/create_saucy_tables.rb
|
116
|
+
- lib/generators/saucy/install/templates/controllers/projects_controller.rb
|
117
|
+
- lib/generators/saucy/install/templates/models/project.rb
|
118
|
+
- lib/generators/saucy/install/templates/models/plan.rb
|
119
|
+
- lib/generators/saucy/install/templates/models/account.rb
|
120
|
+
- lib/generators/saucy/install/templates/models/invitation_mailer.rb
|
113
121
|
- lib/generators/saucy/features/features_generator.rb
|
114
122
|
- lib/generators/saucy/features/templates/factories.rb
|
115
|
-
- lib/generators/saucy/features/templates/step_definitions/email_steps.rb
|
116
123
|
- lib/generators/saucy/features/templates/step_definitions/factory_girl_steps.rb
|
117
124
|
- lib/generators/saucy/features/templates/step_definitions/html_steps.rb
|
118
|
-
- lib/generators/saucy/features/templates/step_definitions/project_steps.rb
|
119
125
|
- lib/generators/saucy/features/templates/step_definitions/session_steps.rb
|
126
|
+
- lib/generators/saucy/features/templates/step_definitions/project_steps.rb
|
127
|
+
- lib/generators/saucy/features/templates/step_definitions/email_steps.rb
|
120
128
|
- lib/generators/saucy/features/templates/step_definitions/user_steps.rb
|
121
|
-
- lib/
|
122
|
-
- lib/
|
123
|
-
- lib/generators/saucy/install/templates/create_saucy_tables.rb
|
124
|
-
- lib/generators/saucy/install/templates/models/account.rb
|
125
|
-
- lib/generators/saucy/install/templates/models/invitation_mailer.rb
|
126
|
-
- lib/generators/saucy/install/templates/models/plan.rb
|
127
|
-
- lib/generators/saucy/install/templates/models/project.rb
|
128
|
-
- lib/generators/saucy/views/views_generator.rb
|
129
|
-
- lib/saucy/account.rb
|
129
|
+
- lib/saucy.rb
|
130
|
+
- lib/saucy/layouts.rb
|
130
131
|
- lib/saucy/account_authorization.rb
|
131
132
|
- lib/saucy/configuration.rb
|
132
133
|
- lib/saucy/engine.rb
|
133
|
-
- lib/saucy/layouts.rb
|
134
|
-
- lib/saucy/plan.rb
|
135
134
|
- lib/saucy/project.rb
|
136
|
-
- lib/saucy/
|
135
|
+
- lib/saucy/plan.rb
|
136
|
+
- lib/saucy/account.rb
|
137
137
|
- lib/saucy/user.rb
|
138
|
-
- lib/saucy.rb
|
138
|
+
- lib/saucy/projects_controller.rb
|
139
139
|
- features/run_features.feature
|
140
|
-
- features/step_definitions/clearance_steps.rb
|
141
|
-
- features/step_definitions/rails_steps.rb
|
142
|
-
- features/support/env.rb
|
143
140
|
- features/support/file.rb
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
141
|
+
- features/support/env.rb
|
142
|
+
- features/step_definitions/rails_steps.rb
|
143
|
+
- features/step_definitions/clearance_steps.rb
|
144
|
+
- lib/generators/saucy/features/templates/README
|
147
145
|
- lib/generators/saucy/features/templates/features/manage_account.feature
|
148
|
-
- lib/generators/saucy/features/templates/features/manage_projects.feature
|
149
146
|
- lib/generators/saucy/features/templates/features/manage_users.feature
|
150
|
-
- lib/generators/saucy/features/templates/features/
|
147
|
+
- lib/generators/saucy/features/templates/features/edit_profile.feature
|
148
|
+
- lib/generators/saucy/features/templates/features/edit_user_permissions.feature
|
151
149
|
- lib/generators/saucy/features/templates/features/sign_up.feature
|
152
|
-
- lib/generators/saucy/features/templates/
|
153
|
-
-
|
150
|
+
- lib/generators/saucy/features/templates/features/new_account.feature
|
151
|
+
- lib/generators/saucy/features/templates/features/manage_projects.feature
|
152
|
+
- lib/generators/saucy/features/templates/features/edit_project_permissions.feature
|
153
|
+
- spec/views/accounts/_account.html.erb_spec.rb
|
154
|
+
- spec/scaffold/config/routes.rb
|
154
155
|
- spec/controllers/application_controller_spec.rb
|
155
156
|
- spec/controllers/invitations_controller_spec.rb
|
157
|
+
- spec/controllers/accounts_controller_spec.rb
|
156
158
|
- spec/controllers/memberships_controller_spec.rb
|
157
159
|
- spec/controllers/profiles_controller_spec.rb
|
158
160
|
- spec/controllers/projects_controller_spec.rb
|
159
|
-
- spec/environment.rb
|
160
161
|
- spec/layouts_spec.rb
|
161
|
-
- spec/
|
162
|
-
- spec/
|
162
|
+
- spec/saucy_spec.rb
|
163
|
+
- spec/support/clearance_matchers.rb
|
164
|
+
- spec/support/authorization_helpers.rb
|
165
|
+
- spec/support/authentication_helpers.rb
|
166
|
+
- spec/models/user_spec.rb
|
167
|
+
- spec/models/signup_spec.rb
|
168
|
+
- spec/models/project_spec.rb
|
163
169
|
- spec/models/membership_spec.rb
|
170
|
+
- spec/models/invitation_spec.rb
|
164
171
|
- spec/models/permission_spec.rb
|
165
|
-
- spec/models/
|
166
|
-
- spec/models/signup_spec.rb
|
167
|
-
- spec/models/user_spec.rb
|
168
|
-
- spec/saucy_spec.rb
|
169
|
-
- spec/scaffold/config/routes.rb
|
172
|
+
- spec/models/account_spec.rb
|
170
173
|
- spec/spec_helper.rb
|
171
|
-
- spec/
|
172
|
-
- spec/support/authorization_helpers.rb
|
173
|
-
- spec/support/clearance_matchers.rb
|
174
|
-
- spec/views/accounts/_account.html.erb_spec.rb
|
174
|
+
- spec/environment.rb
|
175
175
|
has_rdoc: true
|
176
176
|
homepage: http://github.com/thoughtbot/saucy
|
177
177
|
licenses: []
|
@@ -208,7 +208,7 @@ specification_version: 3
|
|
208
208
|
summary: Clearance-based Rails engine for SaaS
|
209
209
|
test_files:
|
210
210
|
- features/run_features.feature
|
211
|
-
- features/step_definitions/clearance_steps.rb
|
212
|
-
- features/step_definitions/rails_steps.rb
|
213
|
-
- features/support/env.rb
|
214
211
|
- features/support/file.rb
|
212
|
+
- features/support/env.rb
|
213
|
+
- features/step_definitions/rails_steps.rb
|
214
|
+
- features/step_definitions/clearance_steps.rb
|