saucy 0.5.5 → 0.6.0
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/CHANGELOG.md +7 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +6 -8
- data/app/controllers/accounts_controller.rb +1 -1
- data/app/controllers/invitations_controller.rb +1 -1
- data/app/controllers/profiles_controller.rb +1 -1
- data/app/models/invitation.rb +1 -3
- data/app/models/signup.rb +0 -1
- data/app/views/invitations/show.html.erb +0 -1
- data/app/views/profiles/_inputs.html.erb +0 -1
- data/app/views/profiles/edit.html.erb +0 -1
- data/features/step_definitions/clearance_steps.rb +2 -2
- data/lib/generators/saucy/features/features_generator.rb +1 -1
- data/lib/generators/saucy/features/templates/factories.rb +0 -1
- data/lib/generators/saucy/features/templates/features/manage_users.feature +6 -7
- data/lib/generators/saucy/features/templates/step_definitions/session_steps.rb +1 -1
- data/lib/saucy/projects_controller.rb +1 -1
- data/lib/saucy/user.rb +1 -1
- data/spec/models/invitation_spec.rb +5 -14
- data/spec/models/signup_spec.rb +2 -6
- metadata +33 -17
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
0.6.0
|
2
|
+
|
3
|
+
Upgrading to, and making an explicit dependency on Clearance ~> 0.11.0. You can
|
4
|
+
get an overview of the important changes to clearance here:
|
5
|
+
|
6
|
+
https://github.com/thoughtbot/clearance/wiki/upgrading-clearance
|
7
|
+
|
1
8
|
0.5.5
|
2
9
|
|
3
10
|
Fixes for account and project keywords containing special characters, generated by signup
|
data/Gemfile
CHANGED
@@ -5,7 +5,7 @@ gem "rake"
|
|
5
5
|
gem "rspec-rails", :require => false
|
6
6
|
gem "rails", ">= 3.0.3"
|
7
7
|
gem "thin"
|
8
|
-
gem "clearance",
|
8
|
+
gem "clearance", "~> 0.11.0"
|
9
9
|
gem "shoulda", :require => false
|
10
10
|
gem "bourne", :require => false
|
11
11
|
gem "sqlite3", :require => false
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,3 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/thoughtbot/clearance.git
|
3
|
-
revision: 7fb410051e0e7cce758883c98ec7b13824265cd0
|
4
|
-
specs:
|
5
|
-
clearance (0.9.1)
|
6
|
-
rails (~> 3.0.0)
|
7
|
-
|
8
1
|
GEM
|
9
2
|
remote: http://rubygems.org/
|
10
3
|
specs:
|
@@ -57,6 +50,9 @@ GEM
|
|
57
50
|
celerity (0.8.8)
|
58
51
|
childprocess (0.1.7)
|
59
52
|
ffi (~> 0.6.3)
|
53
|
+
clearance (0.11.1)
|
54
|
+
diesel (~> 0.1.4)
|
55
|
+
rails (~> 3.0.0)
|
60
56
|
configuration (1.2.0)
|
61
57
|
cucumber (0.9.4)
|
62
58
|
builder (~> 2.1.2)
|
@@ -69,6 +65,8 @@ GEM
|
|
69
65
|
culerity (0.2.15)
|
70
66
|
daemons (1.1.0)
|
71
67
|
database_cleaner (0.6.0)
|
68
|
+
diesel (0.1.4)
|
69
|
+
railties (~> 3.0.3)
|
72
70
|
diff-lcs (1.1.2)
|
73
71
|
dynamic_form (1.1.3)
|
74
72
|
erubis (2.6.6)
|
@@ -170,7 +168,7 @@ DEPENDENCIES
|
|
170
168
|
bourne
|
171
169
|
braintree
|
172
170
|
capybara
|
173
|
-
clearance
|
171
|
+
clearance (~> 0.11.0)
|
174
172
|
cucumber
|
175
173
|
cucumber-rails
|
176
174
|
database_cleaner
|
@@ -1,5 +1,5 @@
|
|
1
1
|
class AccountsController < ApplicationController
|
2
|
-
before_filter :
|
2
|
+
before_filter :authorize, :only => [:index, :edit, :update]
|
3
3
|
before_filter :authorize_admin, :except => [:new, :create, :index]
|
4
4
|
before_filter :ensure_active_account, :only => [:edit, :update]
|
5
5
|
layout Saucy::Layouts.to_proc
|
@@ -1,7 +1,7 @@
|
|
1
1
|
class InvitationsController < ApplicationController
|
2
2
|
before_filter :authorize_admin, :except => [:show, :update]
|
3
3
|
before_filter :ensure_account_within_users_limit, :only => [:new, :create]
|
4
|
-
skip_before_filter :
|
4
|
+
skip_before_filter :authorize, :only => [:show, :update]
|
5
5
|
layout Saucy::Layouts.to_proc
|
6
6
|
|
7
7
|
def new
|
data/app/models/invitation.rb
CHANGED
@@ -8,8 +8,7 @@ class Invitation < ActiveRecord::Base
|
|
8
8
|
before_create :generate_code
|
9
9
|
after_create :deliver_invitation
|
10
10
|
|
11
|
-
attr_accessor :new_user_name, :new_user_password,
|
12
|
-
:new_user_password_confirmation, :authenticating_user_password, :existing_user
|
11
|
+
attr_accessor :new_user_name, :new_user_password, :authenticating_user_password, :existing_user
|
13
12
|
attr_writer :new_user_email, :authenticating_user_email
|
14
13
|
attr_protected :account_id, :used
|
15
14
|
attr_reader :user
|
@@ -79,7 +78,6 @@ class Invitation < ActiveRecord::Base
|
|
79
78
|
User.new(
|
80
79
|
:email => new_user_email,
|
81
80
|
:password => new_user_password,
|
82
|
-
:password_confirmation => new_user_password_confirmation,
|
83
81
|
:name => new_user_name
|
84
82
|
)
|
85
83
|
end
|
data/app/models/signup.rb
CHANGED
@@ -8,7 +8,6 @@
|
|
8
8
|
<%= form.input :new_user_email, :label => 'Email' %>
|
9
9
|
<%= form.input :new_user_name, :label => 'Name' %>
|
10
10
|
<%= form.input :new_user_password, :label => 'Password' %>
|
11
|
-
<%= form.input :new_user_password_confirmation, :label => 'Confirm password' %>
|
12
11
|
<% end -%>
|
13
12
|
|
14
13
|
<h5 class="legend">I am an existing user</h5>
|
@@ -2,8 +2,8 @@ When /^I bootstrap the application for clearance$/ do
|
|
2
2
|
steps %{
|
3
3
|
When I remove the file "public/index.html"
|
4
4
|
And I successfully run "rails generate cucumber:install"
|
5
|
-
And I successfully run "rails generate clearance"
|
6
|
-
And I successfully run "rails generate
|
5
|
+
And I successfully run "rails generate clearance:install"
|
6
|
+
And I successfully run "rails generate clearance:features"
|
7
7
|
And I configure ActionMailer to use "www.example.com" as a host
|
8
8
|
And I add flash messages to the layout
|
9
9
|
And I add session links to the layout
|
@@ -23,7 +23,6 @@ Feature: Managing users
|
|
23
23
|
And I fill in the following new user:
|
24
24
|
| Name | Billy |
|
25
25
|
| Password | secret |
|
26
|
-
| Confirm password | secret |
|
27
26
|
And I press "Accept Invitation"
|
28
27
|
Then I should be signed in
|
29
28
|
And "invitee@example.com" should be a member of the "See me" project
|
@@ -34,8 +33,8 @@ Feature: Managing users
|
|
34
33
|
|
35
34
|
Scenario: Invite existing user who is not signed in
|
36
35
|
Given the following user exists:
|
37
|
-
| email | password |
|
38
|
-
| invitee@example.com | secret |
|
36
|
+
| email | password |
|
37
|
+
| invitee@example.com | secret |
|
39
38
|
When I follow "Invite user"
|
40
39
|
And I fill in "Email" with "invitee@example.com"
|
41
40
|
And I press "Invite User"
|
@@ -50,8 +49,8 @@ Feature: Managing users
|
|
50
49
|
|
51
50
|
Scenario: Invite existing user who is signed in
|
52
51
|
Given the following user exists:
|
53
|
-
| email | password |
|
54
|
-
| invitee@example.com | secret |
|
52
|
+
| email | password |
|
53
|
+
| invitee@example.com | secret |
|
55
54
|
When I follow "Invite user"
|
56
55
|
And I fill in "Email" with "invitee@example.com"
|
57
56
|
And I press "Invite User"
|
@@ -72,8 +71,8 @@ Feature: Managing users
|
|
72
71
|
|
73
72
|
Scenario: Invite admin users
|
74
73
|
Given the following user exists:
|
75
|
-
| email | password |
|
76
|
-
| invitee@example.com | secret |
|
74
|
+
| email | password |
|
75
|
+
| invitee@example.com | secret |
|
77
76
|
When I follow "Invite user"
|
78
77
|
And I fill in "Email" with "invitee@example.com"
|
79
78
|
And I check "Grant administrator privileges"
|
@@ -20,7 +20,7 @@ end
|
|
20
20
|
|
21
21
|
When /^I sign in as "([^"\/]*)"$/ do |email|
|
22
22
|
user = User.find_by_email!(email)
|
23
|
-
user.update_attributes!(:password => 'test'
|
23
|
+
user.update_attributes!(:password => 'test')
|
24
24
|
When %{I sign in as "#{email}/test"}
|
25
25
|
end
|
26
26
|
|
@@ -3,7 +3,7 @@ module Saucy
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
before_filter :
|
6
|
+
before_filter :authorize
|
7
7
|
before_filter :authorize_member, :only => :show
|
8
8
|
before_filter :authorize_admin, :except => [:show]
|
9
9
|
before_filter :ensure_active_account, :only => [:show, :destroy, :index]
|
data/lib/saucy/user.rb
CHANGED
@@ -3,7 +3,7 @@ module Saucy
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
-
attr_accessible :name, :project_ids, :email, :
|
6
|
+
attr_accessible :name, :project_ids, :email, :password
|
7
7
|
has_many :memberships
|
8
8
|
has_many :accounts, :through => :memberships
|
9
9
|
has_many :permissions
|
@@ -10,8 +10,7 @@ describe Invitation do
|
|
10
10
|
it { should_not allow_mass_assignment_of(:account_id) }
|
11
11
|
it { should_not allow_mass_assignment_of(:used) }
|
12
12
|
|
13
|
-
%w(new_user_name new_user_email new_user_password
|
14
|
-
new_user_password_confirmation authenticating_user_password).each do |attribute|
|
13
|
+
%w(new_user_name new_user_email new_user_password authenticating_user_password).each do |attribute|
|
15
14
|
it "allows assignment of #{attribute}" do
|
16
15
|
should respond_to(attribute)
|
17
16
|
should respond_to(:"#{attribute}=")
|
@@ -74,9 +73,7 @@ describe Invitation, "valid accept for a new user" do
|
|
74
73
|
subject { Factory(:invitation, :account => account, :projects => projects) }
|
75
74
|
|
76
75
|
let!(:result) do
|
77
|
-
subject.accept(:new_user_password
|
78
|
-
:new_user_password_confirmation => password,
|
79
|
-
:new_user_name => name)
|
76
|
+
subject.accept(:new_user_password => password, :new_user_name => name)
|
80
77
|
end
|
81
78
|
|
82
79
|
let(:user) { subject.user }
|
@@ -131,9 +128,7 @@ end
|
|
131
128
|
|
132
129
|
describe Invitation, "valid accept for an existing user authenticating" do
|
133
130
|
let(:password) { 'secret' }
|
134
|
-
let(:user) { Factory(:user,
|
135
|
-
:password => password,
|
136
|
-
:password_confirmation => password) }
|
131
|
+
let(:user) { Factory(:user, :password => password) }
|
137
132
|
subject { Factory(:invitation, :email => user.email) }
|
138
133
|
let(:account) { subject.account }
|
139
134
|
|
@@ -242,9 +237,7 @@ describe Invitation, "valid accept for a new user" do
|
|
242
237
|
subject { Factory(:invitation, :account => account, :projects => projects) }
|
243
238
|
|
244
239
|
let!(:result) do
|
245
|
-
subject.accept(:new_user_password
|
246
|
-
:new_user_password_confirmation => password,
|
247
|
-
:new_user_name => name)
|
240
|
+
subject.accept(:new_user_password => password, :new_user_name => name)
|
248
241
|
end
|
249
242
|
|
250
243
|
let(:user) { subject.user }
|
@@ -313,9 +306,7 @@ end
|
|
313
306
|
|
314
307
|
describe Invitation, "accepting an admin invite" do
|
315
308
|
let(:password) { 'secret' }
|
316
|
-
let(:user) { Factory(:user,
|
317
|
-
:password => password,
|
318
|
-
:password_confirmation => password) }
|
309
|
+
let(:user) { Factory(:user, :password => password) }
|
319
310
|
subject { Factory(:invitation, :email => user.email, :admin => true) }
|
320
311
|
let(:account) { subject.account }
|
321
312
|
|
data/spec/models/signup_spec.rb
CHANGED
@@ -124,9 +124,7 @@ describe Signup, "valid with an existing user and correct password" do
|
|
124
124
|
it_should_behave_like "valid signup"
|
125
125
|
let(:email) { "user@example.com" }
|
126
126
|
let(:password) { "test" }
|
127
|
-
let!(:user) { Factory(:user, :email
|
128
|
-
:password => password,
|
129
|
-
:password_confirmation => password) }
|
127
|
+
let!(:user) { Factory(:user, :email => email, :password => password) }
|
130
128
|
subject { Factory.build(:signup, :email => email, :password => password) }
|
131
129
|
before { @result = subject.save }
|
132
130
|
|
@@ -160,9 +158,7 @@ describe Signup, "valid with an existing user and incorrect password" do
|
|
160
158
|
it_should_behave_like "invalid signup"
|
161
159
|
let(:email) { "user@example.com" }
|
162
160
|
let(:password) { "test" }
|
163
|
-
let!(:user) { Factory(:user, :email
|
164
|
-
:password => password,
|
165
|
-
:password_confirmation => password) }
|
161
|
+
let!(:user) { Factory(:user, :email => email, :password => password) }
|
166
162
|
subject { Factory.build(:signup, :email => email, :password => 'wrong') }
|
167
163
|
before { @result = subject.save }
|
168
164
|
|
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: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 6
|
9
|
+
- 0
|
10
|
+
version: 0.6.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- thoughtbot, inc.
|
@@ -18,13 +18,29 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-
|
21
|
+
date: 2011-05-02 00:00:00 -04:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
|
-
name:
|
25
|
+
name: clearance
|
26
26
|
prerelease: false
|
27
27
|
requirement: &id001 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
hash: 51
|
33
|
+
segments:
|
34
|
+
- 0
|
35
|
+
- 11
|
36
|
+
- 0
|
37
|
+
version: 0.11.0
|
38
|
+
type: :runtime
|
39
|
+
version_requirements: *id001
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: formtastic
|
42
|
+
prerelease: false
|
43
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
28
44
|
none: false
|
29
45
|
requirements:
|
30
46
|
- - ">="
|
@@ -35,11 +51,11 @@ dependencies:
|
|
35
51
|
- 2
|
36
52
|
version: "1.2"
|
37
53
|
type: :runtime
|
38
|
-
version_requirements: *
|
54
|
+
version_requirements: *id002
|
39
55
|
- !ruby/object:Gem::Dependency
|
40
56
|
name: railties
|
41
57
|
prerelease: false
|
42
|
-
requirement: &
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
43
59
|
none: false
|
44
60
|
requirements:
|
45
61
|
- - ">="
|
@@ -51,11 +67,11 @@ dependencies:
|
|
51
67
|
- 3
|
52
68
|
version: 3.0.3
|
53
69
|
type: :runtime
|
54
|
-
version_requirements: *
|
70
|
+
version_requirements: *id003
|
55
71
|
- !ruby/object:Gem::Dependency
|
56
72
|
name: braintree
|
57
73
|
prerelease: false
|
58
|
-
requirement: &
|
74
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
59
75
|
none: false
|
60
76
|
requirements:
|
61
77
|
- - ">="
|
@@ -67,11 +83,11 @@ dependencies:
|
|
67
83
|
- 2
|
68
84
|
version: 2.6.2
|
69
85
|
type: :runtime
|
70
|
-
version_requirements: *
|
86
|
+
version_requirements: *id004
|
71
87
|
- !ruby/object:Gem::Dependency
|
72
88
|
name: sham_rack
|
73
89
|
prerelease: false
|
74
|
-
requirement: &
|
90
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
75
91
|
none: false
|
76
92
|
requirements:
|
77
93
|
- - "="
|
@@ -83,11 +99,11 @@ dependencies:
|
|
83
99
|
- 3
|
84
100
|
version: 1.3.3
|
85
101
|
type: :runtime
|
86
|
-
version_requirements: *
|
102
|
+
version_requirements: *id005
|
87
103
|
- !ruby/object:Gem::Dependency
|
88
104
|
name: sinatra
|
89
105
|
prerelease: false
|
90
|
-
requirement: &
|
106
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
91
107
|
none: false
|
92
108
|
requirements:
|
93
109
|
- - ">="
|
@@ -99,11 +115,11 @@ dependencies:
|
|
99
115
|
- 2
|
100
116
|
version: 1.1.2
|
101
117
|
type: :runtime
|
102
|
-
version_requirements: *
|
118
|
+
version_requirements: *id006
|
103
119
|
- !ruby/object:Gem::Dependency
|
104
120
|
name: aruba
|
105
121
|
prerelease: false
|
106
|
-
requirement: &
|
122
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
107
123
|
none: false
|
108
124
|
requirements:
|
109
125
|
- - "="
|
@@ -115,7 +131,7 @@ dependencies:
|
|
115
131
|
- 6
|
116
132
|
version: 0.2.6
|
117
133
|
type: :development
|
118
|
-
version_requirements: *
|
134
|
+
version_requirements: *id007
|
119
135
|
description: Clearance-based Rails engine for Software as a Service (Saas) that provides account and project management
|
120
136
|
email: support@thoughtbot.com
|
121
137
|
executables: []
|