saucy 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/config/routes.rb +8 -8
- data/lib/saucy.rb +1 -0
- data/lib/saucy/routing_extensions.rb +121 -0
- data/spec/controllers/accounts_controller_spec.rb +2 -2
- data/spec/controllers/invitations_controller_spec.rb +14 -7
- data/spec/controllers/memberships_controller_spec.rb +11 -9
- data/spec/controllers/projects_controller_spec.rb +18 -13
- data/spec/route_extensions_spec.rb +51 -0
- metadata +79 -77
data/config/routes.rb
CHANGED
@@ -1,17 +1,17 @@
|
|
1
|
+
require 'saucy/routing_extensions'
|
2
|
+
|
1
3
|
Rails.application.routes.draw do
|
2
|
-
resources :accounts, :only => [:index, :edit, :update]
|
3
|
-
resources :projects, :only => [:new, :create, :index, :show]
|
4
|
-
resources :memberships, :only => [:index]
|
5
|
-
resources :invitations, :only => [:new, :create]
|
6
|
-
end
|
4
|
+
resources :accounts, :only => [:index, :edit, :update]
|
7
5
|
|
8
|
-
|
6
|
+
through :accounts do
|
7
|
+
resources :projects
|
8
|
+
resources :memberships, :only => [:index, :edit, :update, :destroy]
|
9
|
+
resources :invitations, :only => [:show, :update, :new, :create]
|
10
|
+
end
|
9
11
|
|
10
12
|
resources :plans, :only => [:index] do
|
11
13
|
resources :accounts, :only => [:new, :create]
|
12
14
|
end
|
13
15
|
|
14
|
-
resources :invitations, :only => [:show, :update]
|
15
|
-
resources :projects, :only => [:edit, :update, :destroy]
|
16
16
|
resource :profile, :only => [:edit, :update]
|
17
17
|
end
|
data/lib/saucy.rb
CHANGED
@@ -0,0 +1,121 @@
|
|
1
|
+
# This set of hacks extends Rails routing so that we can define pretty, unique,
|
2
|
+
# urls for account resources without having to specify every nested resource
|
3
|
+
# every time we generate a url.
|
4
|
+
#
|
5
|
+
# For example, you can generate /accounts/thoughtbot/projects/hoptoad from
|
6
|
+
# project_path(@project), because the account can be inferred from the project.
|
7
|
+
module Saucy
|
8
|
+
module MapperExtensions
|
9
|
+
def initialize(*args)
|
10
|
+
@through_scope = []
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
14
|
+
def through(parent, &block)
|
15
|
+
@through_scope << parent
|
16
|
+
resources(parent, :only => [], &block)
|
17
|
+
@through_scope.pop
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
22
|
+
class ThroughAlias
|
23
|
+
attr_reader :route, :through
|
24
|
+
|
25
|
+
def initialize(route, through)
|
26
|
+
@route = route
|
27
|
+
@through = through
|
28
|
+
end
|
29
|
+
|
30
|
+
def to_method(kind)
|
31
|
+
return <<-RUBY
|
32
|
+
def #{alias_name}_#{kind}(#{arguments.last}, options = {})
|
33
|
+
#{route_name}_#{kind}(#{arguments.join(', ')}, options)
|
34
|
+
end
|
35
|
+
RUBY
|
36
|
+
end
|
37
|
+
|
38
|
+
private
|
39
|
+
|
40
|
+
def alias_name
|
41
|
+
@alias_name ||= through.inject(route_name) do |name, through|
|
42
|
+
prefix = "#{through.to_s.singularize}_"
|
43
|
+
name.sub(/^(new_|edit_|)#{Regexp.escape(prefix)}/, '\1')
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def arguments
|
48
|
+
@arguments ||= build_arguments
|
49
|
+
end
|
50
|
+
|
51
|
+
def build_arguments
|
52
|
+
other_segments = segments.dup
|
53
|
+
first_segment = other_segments.shift
|
54
|
+
other_segments.inject([first_segment]) { |result, member|
|
55
|
+
result << "#{result.last}.#{member}"
|
56
|
+
}.reverse
|
57
|
+
end
|
58
|
+
|
59
|
+
def segments
|
60
|
+
parent_segments = through.map { |parent| parent.to_s.singularize }.reverse
|
61
|
+
if include_self?
|
62
|
+
[alias_name] + parent_segments
|
63
|
+
else
|
64
|
+
parent_segments
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def route_name
|
69
|
+
route.name
|
70
|
+
end
|
71
|
+
|
72
|
+
def include_self?
|
73
|
+
route.segment_keys.include?(:id)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
ActionDispatch::Routing::Mapper.class_eval do
|
79
|
+
include Saucy::MapperExtensions
|
80
|
+
end
|
81
|
+
|
82
|
+
ActionDispatch::Routing::Mapper::Base.class_eval do
|
83
|
+
def match_with_through(path, options=nil)
|
84
|
+
match_without_through(path, options)
|
85
|
+
unless @through_scope.empty?
|
86
|
+
route = @set.routes.last
|
87
|
+
@set.named_routes.add_through_alias(route, @through_scope) if route.name
|
88
|
+
end
|
89
|
+
self
|
90
|
+
end
|
91
|
+
|
92
|
+
alias_method_chain :match, :through
|
93
|
+
end
|
94
|
+
|
95
|
+
ActionDispatch::Routing::RouteSet::NamedRouteCollection.class_eval do
|
96
|
+
attr_reader :through_aliases
|
97
|
+
|
98
|
+
def clear_with_through_aliases!
|
99
|
+
clear_without_through_aliases!
|
100
|
+
@through_aliases = []
|
101
|
+
end
|
102
|
+
alias_method_chain :clear!, :through_aliases
|
103
|
+
|
104
|
+
def reset_with_through_aliases!
|
105
|
+
old_through_aliases = through_aliases.dup
|
106
|
+
reset_without_through_aliases!
|
107
|
+
old_through_aliases.each do |through_alias|
|
108
|
+
add_through_alias through_alias.route, through_alias.through
|
109
|
+
end
|
110
|
+
end
|
111
|
+
alias_method_chain :reset!, :through_aliases
|
112
|
+
|
113
|
+
def add_through_alias(route, through)
|
114
|
+
@through_aliases ||= []
|
115
|
+
through_alias = Saucy::ThroughAlias.new(route, through)
|
116
|
+
@through_aliases << through_alias
|
117
|
+
@module.module_eval through_alias.to_method('path')
|
118
|
+
@module.module_eval through_alias.to_method('url')
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
@@ -154,7 +154,7 @@ end
|
|
154
154
|
describe AccountsController, "index with one project" do
|
155
155
|
let(:user) { Factory.stub(:user) }
|
156
156
|
let(:accounts) { %w(one two) }
|
157
|
-
let(:projects) {
|
157
|
+
let(:projects) { [Factory.stub(:project)] }
|
158
158
|
|
159
159
|
before do
|
160
160
|
user.stubs(:accounts => accounts)
|
@@ -164,7 +164,7 @@ describe AccountsController, "index with one project" do
|
|
164
164
|
end
|
165
165
|
|
166
166
|
it "redirects to the project" do
|
167
|
-
should redirect_to(project_url(projects.first))
|
167
|
+
should redirect_to(controller.project_url(projects.first))
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
@@ -5,10 +5,10 @@ describe InvitationsController, "routes" do
|
|
5
5
|
to(:action => :new, :account_id => 'abc') }
|
6
6
|
it { should route(:post, "/accounts/abc/invitations").
|
7
7
|
to(:action => :create, :account_id => 'abc') }
|
8
|
-
it { should route(:get, "/invitations/xyz").
|
9
|
-
to(:action => :show, :id => 'xyz') }
|
10
|
-
it { should route(:put, "/invitations/xyz").
|
11
|
-
to(:action => :update, :id => 'xyz') }
|
8
|
+
it { should route(:get, "/accounts/abc/invitations/xyz").
|
9
|
+
to(:action => :show, :account_id => 'abc', :id => 'xyz') }
|
10
|
+
it { should route(:put, "/accounts/abc/invitations/xyz").
|
11
|
+
to(:action => :update, :account_id => 'abc', :id => 'xyz') }
|
12
12
|
end
|
13
13
|
|
14
14
|
describe InvitationsController, "permissions" do
|
@@ -102,10 +102,11 @@ end
|
|
102
102
|
|
103
103
|
describe InvitationsController, "show" do
|
104
104
|
let(:invitation) { Factory.stub(:invitation) }
|
105
|
+
let(:account) { invitation.account }
|
105
106
|
|
106
107
|
before do
|
107
108
|
Invitation.stubs(:find => invitation)
|
108
|
-
get :show, :id => invitation.to_param
|
109
|
+
get :show, :id => invitation.to_param, :account_id => account.to_param
|
109
110
|
end
|
110
111
|
|
111
112
|
it "renders the show template" do
|
@@ -121,6 +122,7 @@ end
|
|
121
122
|
|
122
123
|
describe InvitationsController, "valid update" do
|
123
124
|
let(:invitation) { Factory.stub(:invitation) }
|
125
|
+
let(:account) { invitation.account }
|
124
126
|
let(:attributes) { 'attributes' }
|
125
127
|
let(:user) { Factory.stub(:user) }
|
126
128
|
|
@@ -128,7 +130,9 @@ describe InvitationsController, "valid update" do
|
|
128
130
|
Invitation.stubs(:find => invitation)
|
129
131
|
invitation.stubs(:accept => true)
|
130
132
|
invitation.stubs(:user => user)
|
131
|
-
put :update, :id
|
133
|
+
put :update, :id => invitation.to_param,
|
134
|
+
:account_id => account.to_param,
|
135
|
+
:invitation => attributes
|
132
136
|
end
|
133
137
|
|
134
138
|
it "signs the user in" do
|
@@ -147,11 +151,14 @@ end
|
|
147
151
|
|
148
152
|
describe InvitationsController, "invalid update" do
|
149
153
|
let(:invitation) { Factory.stub(:invitation) }
|
154
|
+
let(:account) { invitation.account }
|
150
155
|
|
151
156
|
before do
|
152
157
|
Invitation.stubs(:find => invitation)
|
153
158
|
invitation.stubs(:accept => false)
|
154
|
-
put :update, :id
|
159
|
+
put :update, :id => invitation.to_param,
|
160
|
+
:account_id => account.to_param,
|
161
|
+
:invitation => {}
|
155
162
|
end
|
156
163
|
|
157
164
|
it "doesn't sign in" do
|
@@ -3,12 +3,12 @@ require 'spec_helper'
|
|
3
3
|
describe MembershipsController, "routes" do
|
4
4
|
it { should route(:get, "/accounts/abc/memberships").
|
5
5
|
to(:action => :index, :account_id => 'abc') }
|
6
|
-
it { should route(:get, "/memberships/abc/edit").
|
7
|
-
to(:action => :edit, :id => 'abc') }
|
8
|
-
it { should route(:put, "/memberships/abc").
|
9
|
-
to(:action => :update, :id => 'abc') }
|
10
|
-
it { should route(:delete, "/memberships/abc").
|
11
|
-
to(:action => :destroy, :id => 'abc') }
|
6
|
+
it { should route(:get, "/accounts/xyz/memberships/abc/edit").
|
7
|
+
to(:action => :edit, :account_id => 'xyz', :id => 'abc') }
|
8
|
+
it { should route(:put, "/accounts/xyz/memberships/abc").
|
9
|
+
to(:action => :update, :account_id => 'xyz', :id => 'abc') }
|
10
|
+
it { should route(:delete, "/accounts/xyz/memberships/abc").
|
11
|
+
to(:action => :destroy, :account_id => 'xyz', :id => 'abc') }
|
12
12
|
end
|
13
13
|
|
14
14
|
describe MembershipsController, "permissions", :as => :account_member do
|
@@ -17,7 +17,8 @@ describe MembershipsController, "permissions", :as => :account_member do
|
|
17
17
|
on(:get, :index, :account_id => account.to_param).
|
18
18
|
flash(/admin/) }
|
19
19
|
it { should deny_access.
|
20
|
-
on(:get, :edit, :id
|
20
|
+
on(:get, :edit, :id => membership.to_param,
|
21
|
+
:account_id => account.to_param).
|
21
22
|
flash(/admin/) }
|
22
23
|
end
|
23
24
|
|
@@ -48,7 +49,7 @@ describe MembershipsController, "edit", :as => :account_admin do
|
|
48
49
|
before do
|
49
50
|
Membership.stubs(:find => edited_membership)
|
50
51
|
account.stubs(:projects_by_name => projects)
|
51
|
-
get :edit, :id => edited_membership.to_param
|
52
|
+
get :edit, :id => edited_membership.to_param, :account_id => account.to_param
|
52
53
|
end
|
53
54
|
|
54
55
|
it "renders the edit template" do
|
@@ -76,6 +77,7 @@ describe MembershipsController, "update", :as => :account_admin do
|
|
76
77
|
Membership.stubs(:find => edited_membership)
|
77
78
|
edited_membership.stubs(:update_attributes!)
|
78
79
|
put :update, :id => edited_membership.to_param,
|
80
|
+
:account_id => account.to_param,
|
79
81
|
:membership => attributes
|
80
82
|
end
|
81
83
|
|
@@ -98,7 +100,7 @@ describe MembershipsController, "destroy", :as => :account_admin do
|
|
98
100
|
before do
|
99
101
|
Membership.stubs(:find => removed_membership)
|
100
102
|
removed_membership.stubs(:destroy)
|
101
|
-
delete :destroy, :id => removed_membership.to_param
|
103
|
+
delete :destroy, :id => removed_membership.to_param, :account_id => account.to_param
|
102
104
|
end
|
103
105
|
|
104
106
|
it "redirects to the account memberships index" do
|
@@ -5,12 +5,12 @@ describe ProjectsController, "routes" do
|
|
5
5
|
to(:action => :new, :account_id => 'abc') }
|
6
6
|
it { should route(:post, "/accounts/abc/projects").
|
7
7
|
to(:action => :create, :account_id => 'abc') }
|
8
|
-
it { should route(:get, "/projects/def/edit").
|
9
|
-
to(:action => :edit, :id => 'def') }
|
10
|
-
it { should route(:put, "/projects/def").
|
11
|
-
to(:action => :update, :id => 'def') }
|
12
|
-
it { should route(:delete, "/projects/def").
|
13
|
-
to(:action => :destroy, :id => 'def') }
|
8
|
+
it { should route(:get, "/accounts/abc/projects/def/edit").
|
9
|
+
to(:action => :edit, :account_id => 'abc', :id => 'def') }
|
10
|
+
it { should route(:put, "/accounts/abc/projects/def").
|
11
|
+
to(:action => :update, :account_id => 'abc', :id => 'def') }
|
12
|
+
it { should route(:delete, "/accounts/abc/projects/def").
|
13
|
+
to(:action => :destroy, :account_id => 'abc', :id => 'def') }
|
14
14
|
it { should route(:get, "/accounts/abc/projects").
|
15
15
|
to(:action => :index, :account_id => 'abc') }
|
16
16
|
end
|
@@ -47,13 +47,13 @@ describe ProjectsController, "create", :as => :account_admin do
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it "should redirect to the edit page" do
|
50
|
-
should redirect_to(edit_project_url(assigns(:project)))
|
50
|
+
should redirect_to(controller.edit_project_url(assigns(:project)))
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
54
|
describe ProjectsController, "edit", :as => :project_admin do
|
55
55
|
before do
|
56
|
-
get :edit, :id => project.to_param
|
56
|
+
get :edit, :id => project.to_param, :account_id => account.to_param
|
57
57
|
end
|
58
58
|
|
59
59
|
it { should respond_with(:success) }
|
@@ -64,7 +64,9 @@ end
|
|
64
64
|
|
65
65
|
describe ProjectsController, "update", :as => :project_admin do
|
66
66
|
before do
|
67
|
-
put :update, :project
|
67
|
+
put :update, :project => Factory.attributes_for(:project),
|
68
|
+
:id => project.to_param,
|
69
|
+
:account_id => account.to_param
|
68
70
|
end
|
69
71
|
|
70
72
|
it "should redirect to account_projects_url" do
|
@@ -74,7 +76,7 @@ end
|
|
74
76
|
|
75
77
|
describe ProjectsController, "destroy", :as => :project_admin do
|
76
78
|
before do
|
77
|
-
delete :destroy, :id => project.to_param
|
79
|
+
delete :destroy, :id => project.to_param, :account_id => account.to_param
|
78
80
|
end
|
79
81
|
|
80
82
|
it { should set_the_flash.to(/deleted/) }
|
@@ -106,13 +108,16 @@ describe ProjectsController, "index", :as => :account_admin do
|
|
106
108
|
end
|
107
109
|
|
108
110
|
describe ProjectsController, "as a non-admin", :as => :project_member do
|
109
|
-
it { should deny_access.on(:get, :edit, :id
|
111
|
+
it { should deny_access.on(:get, :edit, :id => project.to_param,
|
112
|
+
:account_id => account.to_param).
|
110
113
|
flash(/admin/) }
|
111
114
|
|
112
|
-
it { should deny_access.on(:put, :update, :id
|
115
|
+
it { should deny_access.on(:put, :update, :id => project.to_param,
|
116
|
+
:account_id => account.to_param).
|
113
117
|
flash(/admin/) }
|
114
118
|
|
115
|
-
it { should deny_access.on(:delete, :destroy, :id
|
119
|
+
it { should deny_access.on(:delete, :destroy, :id => project.to_param,
|
120
|
+
:account_id => account.to_param).
|
116
121
|
flash(/admin/) }
|
117
122
|
|
118
123
|
it { should deny_access.on(:get, :new, :account_id => account.to_param).flash(/admin/) }
|
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe "Saucy routing extensions" do
|
4
|
+
include ActionDispatch::Routing::UrlFor
|
5
|
+
|
6
|
+
let(:_routes) { ActionDispatch::Routing::RouteSet.new }
|
7
|
+
|
8
|
+
before do
|
9
|
+
_routes.draw do
|
10
|
+
resources :accounts
|
11
|
+
through :accounts do
|
12
|
+
resources :projects
|
13
|
+
through :projects do
|
14
|
+
resources :discussions
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
extend(_routes.named_routes.module)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "allows a nested member path to be accessed through just the child's name" do
|
23
|
+
account = stub('account', :to_param => 'abc')
|
24
|
+
project = stub('project', :account => account, :to_param => 'def')
|
25
|
+
project_path(project).should == "/accounts/abc/projects/def"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "allows a nested member url to be accessed through just the child's name" do
|
29
|
+
account = stub('account', :to_param => 'abc')
|
30
|
+
project = stub('project', :account => account, :to_param => 'def')
|
31
|
+
project_url(project, :host => 'example.com').
|
32
|
+
should == "http://example.com/accounts/abc/projects/def"
|
33
|
+
end
|
34
|
+
|
35
|
+
it "allows a nested collection path to be accessed through just the parent's name" do
|
36
|
+
account = stub('account', :to_param => 'abc')
|
37
|
+
projects_path(account).should == "/accounts/abc/projects"
|
38
|
+
end
|
39
|
+
|
40
|
+
it "allows a nested new path to be accessed through just the parent's name" do
|
41
|
+
account = stub('account', :to_param => 'abc')
|
42
|
+
new_project_path(account).should == "/accounts/abc/projects/new"
|
43
|
+
end
|
44
|
+
|
45
|
+
it "allows a doubly nested member path to be access through just the child's name" do
|
46
|
+
account = stub('account', :to_param => 'abc')
|
47
|
+
project = stub('project', :account => account, :to_param => 'def')
|
48
|
+
discussion = stub('discussion', :project => project, :to_param => 'ghi')
|
49
|
+
discussion_path(discussion).should == "/accounts/abc/projects/def/discussions/ghi"
|
50
|
+
end
|
51
|
+
end
|
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: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- thoughtbot, inc.
|
@@ -17,13 +17,14 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2010-12-
|
20
|
+
date: 2010-12-21 00:00:00 -05:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
|
-
|
24
|
+
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
|
26
|
+
name: formtastic
|
27
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
27
28
|
none: false
|
28
29
|
requirements:
|
29
30
|
- - ">="
|
@@ -33,12 +34,12 @@ dependencies:
|
|
33
34
|
- 1
|
34
35
|
- 2
|
35
36
|
version: "1.2"
|
36
|
-
|
37
|
-
version_requirements: *id001
|
37
|
+
requirement: *id001
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
|
-
|
39
|
+
type: :runtime
|
40
40
|
prerelease: false
|
41
|
-
|
41
|
+
name: railties
|
42
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
42
43
|
none: false
|
43
44
|
requirements:
|
44
45
|
- - ">="
|
@@ -49,12 +50,12 @@ dependencies:
|
|
49
50
|
- 0
|
50
51
|
- 3
|
51
52
|
version: 3.0.3
|
52
|
-
|
53
|
-
version_requirements: *id002
|
53
|
+
requirement: *id002
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
|
55
|
+
type: :development
|
56
56
|
prerelease: false
|
57
|
-
|
57
|
+
name: aruba
|
58
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
58
59
|
none: false
|
59
60
|
requirements:
|
60
61
|
- - "="
|
@@ -65,8 +66,7 @@ dependencies:
|
|
65
66
|
- 2
|
66
67
|
- 6
|
67
68
|
version: 0.2.6
|
68
|
-
|
69
|
-
version_requirements: *id003
|
69
|
+
requirement: *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,103 +76,105 @@ extensions: []
|
|
76
76
|
extra_rdoc_files: []
|
77
77
|
|
78
78
|
files:
|
79
|
+
- Gemfile
|
79
80
|
- Gemfile.lock
|
80
81
|
- Rakefile
|
81
82
|
- README
|
82
|
-
- Gemfile
|
83
83
|
- config/routes.rb
|
84
|
-
- app/
|
85
|
-
- app/
|
86
|
-
- app/
|
84
|
+
- app/controllers/accounts_controller.rb
|
85
|
+
- app/controllers/invitations_controller.rb
|
86
|
+
- app/controllers/memberships_controller.rb
|
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
|
87
95
|
- app/views/accounts/_projects.html.erb
|
88
|
-
- app/views/accounts/edit.html.erb
|
89
96
|
- app/views/accounts/_tab_bar.html.erb
|
90
|
-
- app/views/accounts/
|
91
|
-
- app/views/accounts/_account.html.erb
|
97
|
+
- app/views/accounts/edit.html.erb
|
92
98
|
- app/views/accounts/index.html.erb
|
99
|
+
- app/views/accounts/new.html.erb
|
93
100
|
- app/views/invitation_mailer/invitation.text.erb
|
94
|
-
- app/views/
|
101
|
+
- app/views/invitations/new.html.erb
|
102
|
+
- app/views/invitations/show.html.erb
|
95
103
|
- app/views/memberships/edit.html.erb
|
96
104
|
- app/views/memberships/index.html.erb
|
97
|
-
- app/views/
|
105
|
+
- app/views/plans/index.html.erb
|
98
106
|
- app/views/profiles/_inputs.html.erb
|
99
|
-
- app/views/
|
107
|
+
- app/views/profiles/edit.html.erb
|
108
|
+
- app/views/projects/_form.html.erb
|
100
109
|
- app/views/projects/edit.html.erb
|
101
110
|
- app/views/projects/index.html.erb
|
102
|
-
- app/views/projects/
|
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
|
111
|
+
- app/views/projects/new.html.erb
|
113
112
|
- 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
|
121
113
|
- lib/generators/saucy/features/features_generator.rb
|
122
114
|
- lib/generators/saucy/features/templates/factories.rb
|
115
|
+
- lib/generators/saucy/features/templates/step_definitions/email_steps.rb
|
123
116
|
- lib/generators/saucy/features/templates/step_definitions/factory_girl_steps.rb
|
124
117
|
- lib/generators/saucy/features/templates/step_definitions/html_steps.rb
|
125
|
-
- lib/generators/saucy/features/templates/step_definitions/session_steps.rb
|
126
118
|
- lib/generators/saucy/features/templates/step_definitions/project_steps.rb
|
127
|
-
- lib/generators/saucy/features/templates/step_definitions/
|
119
|
+
- lib/generators/saucy/features/templates/step_definitions/session_steps.rb
|
128
120
|
- lib/generators/saucy/features/templates/step_definitions/user_steps.rb
|
129
|
-
- lib/saucy.rb
|
130
|
-
- lib/saucy/
|
121
|
+
- lib/generators/saucy/install/install_generator.rb
|
122
|
+
- lib/generators/saucy/install/templates/controllers/projects_controller.rb
|
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
|
131
130
|
- lib/saucy/account_authorization.rb
|
132
131
|
- lib/saucy/configuration.rb
|
133
132
|
- lib/saucy/engine.rb
|
134
|
-
- lib/saucy/
|
133
|
+
- lib/saucy/layouts.rb
|
135
134
|
- lib/saucy/plan.rb
|
136
|
-
- lib/saucy/
|
137
|
-
- lib/saucy/user.rb
|
135
|
+
- lib/saucy/project.rb
|
138
136
|
- lib/saucy/projects_controller.rb
|
137
|
+
- lib/saucy/routing_extensions.rb
|
138
|
+
- lib/saucy/user.rb
|
139
|
+
- lib/saucy.rb
|
139
140
|
- features/run_features.feature
|
140
|
-
- features/support/file.rb
|
141
|
-
- features/support/env.rb
|
142
|
-
- features/step_definitions/rails_steps.rb
|
143
141
|
- features/step_definitions/clearance_steps.rb
|
144
|
-
-
|
145
|
-
-
|
146
|
-
-
|
142
|
+
- features/step_definitions/rails_steps.rb
|
143
|
+
- features/support/env.rb
|
144
|
+
- features/support/file.rb
|
147
145
|
- lib/generators/saucy/features/templates/features/edit_profile.feature
|
146
|
+
- lib/generators/saucy/features/templates/features/edit_project_permissions.feature
|
148
147
|
- lib/generators/saucy/features/templates/features/edit_user_permissions.feature
|
149
|
-
- lib/generators/saucy/features/templates/features/
|
150
|
-
- lib/generators/saucy/features/templates/features/new_account.feature
|
148
|
+
- lib/generators/saucy/features/templates/features/manage_account.feature
|
151
149
|
- lib/generators/saucy/features/templates/features/manage_projects.feature
|
152
|
-
- lib/generators/saucy/features/templates/features/
|
153
|
-
-
|
154
|
-
-
|
150
|
+
- lib/generators/saucy/features/templates/features/manage_users.feature
|
151
|
+
- lib/generators/saucy/features/templates/features/new_account.feature
|
152
|
+
- lib/generators/saucy/features/templates/features/sign_up.feature
|
153
|
+
- lib/generators/saucy/features/templates/README
|
154
|
+
- spec/controllers/accounts_controller_spec.rb
|
155
155
|
- spec/controllers/application_controller_spec.rb
|
156
156
|
- spec/controllers/invitations_controller_spec.rb
|
157
|
-
- spec/controllers/accounts_controller_spec.rb
|
158
157
|
- spec/controllers/memberships_controller_spec.rb
|
159
158
|
- spec/controllers/profiles_controller_spec.rb
|
160
159
|
- spec/controllers/projects_controller_spec.rb
|
160
|
+
- spec/environment.rb
|
161
161
|
- spec/layouts_spec.rb
|
162
|
-
- spec/
|
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
|
169
|
-
- spec/models/membership_spec.rb
|
162
|
+
- spec/models/account_spec.rb
|
170
163
|
- spec/models/invitation_spec.rb
|
164
|
+
- spec/models/membership_spec.rb
|
171
165
|
- spec/models/permission_spec.rb
|
172
|
-
- spec/models/
|
166
|
+
- spec/models/project_spec.rb
|
167
|
+
- spec/models/signup_spec.rb
|
168
|
+
- spec/models/user_spec.rb
|
169
|
+
- spec/route_extensions_spec.rb
|
170
|
+
- spec/saucy_spec.rb
|
171
|
+
- spec/scaffold/config/routes.rb
|
173
172
|
- spec/spec_helper.rb
|
174
|
-
- spec/
|
175
|
-
|
173
|
+
- spec/support/authentication_helpers.rb
|
174
|
+
- spec/support/authorization_helpers.rb
|
175
|
+
- spec/support/clearance_matchers.rb
|
176
|
+
- spec/views/accounts/_account.html.erb_spec.rb
|
177
|
+
has_rdoc: false
|
176
178
|
homepage: http://github.com/thoughtbot/saucy
|
177
179
|
licenses: []
|
178
180
|
|
@@ -208,7 +210,7 @@ specification_version: 3
|
|
208
210
|
summary: Clearance-based Rails engine for SaaS
|
209
211
|
test_files:
|
210
212
|
- features/run_features.feature
|
211
|
-
- features/support/file.rb
|
212
|
-
- features/support/env.rb
|
213
|
-
- features/step_definitions/rails_steps.rb
|
214
213
|
- features/step_definitions/clearance_steps.rb
|
214
|
+
- features/step_definitions/rails_steps.rb
|
215
|
+
- features/support/env.rb
|
216
|
+
- features/support/file.rb
|