clearance 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of clearance might be problematic. Click here for more details.

@@ -1,3 +1,4 @@
1
+ language: ruby
1
2
  rvm:
2
3
  - ree-1.8.7
3
4
  - 1.8.7
@@ -5,10 +6,12 @@ rvm:
5
6
  - 1.9.3
6
7
  before_install:
7
8
  - gem update --system
8
- script: 'bundle exec rake appraisal spec cucumber'
9
+ before_script:
10
+ - "bundle exec rake db:migrate"
9
11
  gemfile:
10
- - gemfiles/3.0.9.gemfile
11
- - gemfiles/3.1.0.gemfile
12
+ - gemfiles/3.0.12.gemfile
13
+ - gemfiles/3.1.4.gemfile
14
+ - gemfiles/3.2.3.gemfile
12
15
  branches:
13
16
  only:
14
17
  - master
data/Appraisals CHANGED
@@ -1,7 +1,5 @@
1
- appraise "3.0.9" do
2
- gem "rails", "3.0.9"
3
- end
4
-
5
- appraise "3.1.0" do
6
- gem "rails", "3.1.0"
1
+ ['3.2.3', '3.1.4', '3.0.12'].each do |rails_version|
2
+ appraise "#{rails_version}" do
3
+ gem "rails", rails_version
4
+ end
7
5
  end
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source "http://rubygems.org"
2
2
  gemspec
3
3
 
4
4
  gem "capybara", "~> 1.1.1"
5
- gem "factory_girl_rails"
5
+ gem "factory_girl_rails", "1.7.0"
6
6
  gem "shoulda-matchers", :git => "git://github.com/thoughtbot/shoulda-matchers.git"
7
7
  gem "database_cleaner"
8
8
  gem "launchy"
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: .
9
9
  specs:
10
- clearance (0.16.0)
10
+ clearance (0.16.1)
11
11
  diesel (~> 0.1.5)
12
12
  rails (>= 3.0)
13
13
 
@@ -81,21 +81,21 @@ GEM
81
81
  railties
82
82
  diff-lcs (1.1.3)
83
83
  erubis (2.7.0)
84
- factory_girl (2.5.0)
85
- activesupport
86
- factory_girl_rails (1.6.0)
87
- factory_girl (~> 2.5.0)
84
+ factory_girl (2.6.4)
85
+ activesupport (>= 2.3.9)
86
+ factory_girl_rails (1.7.0)
87
+ factory_girl (~> 2.6.0)
88
88
  railties (>= 3.0.0)
89
89
  ffi (1.0.11)
90
90
  gherkin (2.7.6)
91
91
  json (>= 1.4.6)
92
92
  hike (1.2.1)
93
93
  i18n (0.6.0)
94
- journey (1.0.1)
95
- json (1.6.5)
94
+ journey (1.0.3)
95
+ json (1.6.6)
96
96
  launchy (2.0.5)
97
97
  addressable (~> 2.2.6)
98
- mail (2.4.1)
98
+ mail (2.4.4)
99
99
  i18n (>= 0.4.0)
100
100
  mime-types (~> 1.16)
101
101
  treetop (~> 1.4.8)
@@ -106,7 +106,7 @@ GEM
106
106
  nokogiri (1.5.0)
107
107
  polyglot (0.3.3)
108
108
  rack (1.4.1)
109
- rack-cache (1.1)
109
+ rack-cache (1.2)
110
110
  rack (>= 0.4)
111
111
  rack-ssl (1.3.2)
112
112
  rack
@@ -131,19 +131,19 @@ GEM
131
131
  rdiscount (1.6.8)
132
132
  rdoc (3.12)
133
133
  json (~> 1.4)
134
- rspec (2.6.0)
135
- rspec-core (~> 2.6.0)
136
- rspec-expectations (~> 2.6.0)
137
- rspec-mocks (~> 2.6.0)
138
- rspec-core (2.6.4)
139
- rspec-expectations (2.6.0)
140
- diff-lcs (~> 1.1.2)
141
- rspec-mocks (2.6.0)
142
- rspec-rails (2.6.1)
143
- actionpack (~> 3.0)
144
- activesupport (~> 3.0)
145
- railties (~> 3.0)
146
- rspec (~> 2.6.0)
134
+ rspec (2.9.0)
135
+ rspec-core (~> 2.9.0)
136
+ rspec-expectations (~> 2.9.0)
137
+ rspec-mocks (~> 2.9.0)
138
+ rspec-core (2.9.0)
139
+ rspec-expectations (2.9.1)
140
+ diff-lcs (~> 1.1.3)
141
+ rspec-mocks (2.9.0)
142
+ rspec-rails (2.9.0)
143
+ actionpack (>= 3.0)
144
+ activesupport (>= 3.0)
145
+ railties (>= 3.0)
146
+ rspec (~> 2.9.0)
147
147
  rubyzip (0.9.5)
148
148
  selenium-webdriver (2.18.0)
149
149
  childprocess (>= 0.2.5)
@@ -173,14 +173,14 @@ DEPENDENCIES
173
173
  appraisal (~> 0.3.8)
174
174
  aruba (~> 0.4.2)
175
175
  bourne
176
- bundler (~> 1.0.0)
176
+ bundler (~> 1.1.0)
177
177
  capybara (~> 1.1.1)
178
178
  clearance!
179
179
  cucumber-rails (~> 1.1.1)
180
180
  database_cleaner
181
- factory_girl_rails
181
+ factory_girl_rails (= 1.7.0)
182
182
  launchy
183
- rspec-rails (~> 2.6.0)
183
+ rspec-rails (~> 2.9.0)
184
184
  shoulda-matchers!
185
185
  sqlite3
186
186
  timecop
data/NEWS.md CHANGED
@@ -1,3 +1,8 @@
1
+ New for 0.16.1:
2
+
3
+ * Behave correctly when Rails whitelist attributes mass assignment protection is turned on
4
+ * Fix for Rails 3.2.x modifying the HTTP cookie headers in rack requests
5
+
1
6
  New for 0.16.0:
2
7
 
3
8
  * Blowfish password encryption strategy (Chris Dillon)
data/README.md CHANGED
@@ -17,7 +17,7 @@ Help
17
17
  Installation
18
18
  ------------
19
19
 
20
- Clearance is a Rails engine for Rails 3. It is currently tested against Rails 3.0.9 and Rails 3.1.0.
20
+ Clearance is a Rails engine for Rails 3. It is currently tested against Rails 3.0.12 and Rails 3.1.4.
21
21
 
22
22
  Include the gem in your Gemfile:
23
23
 
data/Rakefile CHANGED
@@ -9,11 +9,15 @@ require 'diesel/tasks'
9
9
  require 'rspec/core/rake_task'
10
10
  require 'appraisal'
11
11
 
12
- desc 'Default: run the specs and cucumber features'
13
- task :default => [:all]
12
+ task :default do |t|
13
+ if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
14
+ exec 'rake spec cucumber'
15
+ else
16
+ Rake::Task['appraise'].execute
17
+ end
18
+ end
14
19
 
15
- desc 'Test the plugin under all supported Rails versions.'
16
- task :all => ['appraisal:install'] do |t|
20
+ task :appraise => ['appraisal:install'] do |t|
17
21
  exec 'rake appraisal spec cucumber'
18
22
  end
19
23
 
@@ -5,12 +5,12 @@ class Clearance::UsersController < ApplicationController
5
5
  before_filter :redirect_to_root, :only => [:new, :create], :if => :signed_in?
6
6
 
7
7
  def new
8
- @user = Clearance.configuration.user_model.new(params[:user])
8
+ @user = user_from_params
9
9
  render :template => 'users/new'
10
10
  end
11
11
 
12
12
  def create
13
- @user = Clearance.configuration.user_model.new(params[:user])
13
+ @user = user_from_params
14
14
  if @user.save
15
15
  sign_in(@user)
16
16
  redirect_back_or(url_after_create)
@@ -31,4 +31,13 @@ class Clearance::UsersController < ApplicationController
31
31
  def url_after_create
32
32
  '/'
33
33
  end
34
+
35
+ def user_from_params
36
+ user_params = params[:user] || Hash.new
37
+ email, password = user_params.delete(:email), user_params.delete(:password)
38
+ Clearance.configuration.user_model.new(user_params).tap do |user|
39
+ user.email = email
40
+ user.password = password
41
+ end
42
+ end
34
43
  end
@@ -1,8 +1,10 @@
1
+ $:.push File.expand_path('../lib', __FILE__)
2
+ require 'clearance/version'
1
3
  require 'date'
2
4
 
3
5
  Gem::Specification.new do |s|
4
6
  s.name = %q{clearance}
5
- s.version = IO.read(File.join(File.dirname(__FILE__), 'VERSION'))
7
+ s.version = Clearance::VERSION
6
8
  s.email = %q{support@thoughtbot.com}
7
9
  s.homepage = %q{http://github.com/thoughtbot/clearance}
8
10
 
@@ -25,10 +27,10 @@ Gem::Specification.new do |s|
25
27
  s.add_dependency('rails', '>= 3.0')
26
28
  s.add_dependency('diesel', '~> 0.1.5')
27
29
 
28
- s.add_development_dependency('bundler', '~> 1.0.0')
30
+ s.add_development_dependency('bundler', '~> 1.1.0')
29
31
  s.add_development_dependency('appraisal', '~> 0.3.8')
30
32
  s.add_development_dependency('cucumber-rails', '~> 1.1.1')
31
- s.add_development_dependency('rspec-rails', '~> 2.6.0')
33
+ s.add_development_dependency('rspec-rails', '~> 2.9.0')
32
34
  s.add_development_dependency('sqlite3')
33
35
  s.add_development_dependency('bourne')
34
36
  s.add_development_dependency('timecop')
@@ -38,4 +40,3 @@ Gem::Specification.new do |s|
38
40
  s.specification_version = 3
39
41
  end
40
42
  end
41
-
@@ -1,11 +1,11 @@
1
1
  # Existing users
2
2
 
3
3
  Given /^(?:I am|I have|I) signed up (?:as|with) "(.*)"$/ do |email|
4
- Factory(:user, :email => email)
4
+ FactoryGirl.create(:user, :email => email)
5
5
  end
6
6
 
7
7
  Given /^a user "([^"]*)" exists without a salt, remember token, or password$/ do |email|
8
- user = Factory(:user, :email => email)
8
+ user = FactoryGirl.create(:user, :email => email)
9
9
  sql = "update users set salt = NULL, encrypted_password = NULL, remember_token = NULL where id = #{user.id}"
10
10
  ActiveRecord::Base.connection.update(sql)
11
11
  end
@@ -0,0 +1,13 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "http://rubygems.org"
4
+
5
+ gem "capybara", "~> 1.1.1"
6
+ gem "factory_girl_rails", "1.7.0"
7
+ gem "shoulda-matchers", :git=>"git://github.com/thoughtbot/shoulda-matchers.git"
8
+ gem "database_cleaner"
9
+ gem "launchy"
10
+ gem "aruba", "~> 0.4.2"
11
+ gem "rails", "3.0.12"
12
+
13
+ gemspec :path=>"../"
@@ -1,13 +1,13 @@
1
1
  GIT
2
2
  remote: git://github.com/thoughtbot/shoulda-matchers.git
3
- revision: 25c2623bb9d96cf6a446ecc141fdfefe5c4860fa
3
+ revision: d85503f86ef224bca2b54fc6b9ad96866fe12f2d
4
4
  specs:
5
5
  shoulda-matchers (1.0.0)
6
6
 
7
7
  PATH
8
- remote: /home/mike/lib/clearance
8
+ remote: /Users/mjankowski/Development/opensource/clearance
9
9
  specs:
10
- clearance (0.16.0)
10
+ clearance (0.16.1)
11
11
  diesel (~> 0.1.5)
12
12
  rails (>= 3.0)
13
13
 
@@ -15,47 +15,44 @@ GEM
15
15
  remote: http://rubygems.org/
16
16
  specs:
17
17
  abstract (1.0.0)
18
- actionmailer (3.0.9)
19
- actionpack (= 3.0.9)
18
+ actionmailer (3.0.12)
19
+ actionpack (= 3.0.12)
20
20
  mail (~> 2.2.19)
21
- actionpack (3.0.9)
22
- activemodel (= 3.0.9)
23
- activesupport (= 3.0.9)
21
+ actionpack (3.0.12)
22
+ activemodel (= 3.0.12)
23
+ activesupport (= 3.0.12)
24
24
  builder (~> 2.1.2)
25
25
  erubis (~> 2.6.6)
26
26
  i18n (~> 0.5.0)
27
- rack (~> 1.2.1)
27
+ rack (~> 1.2.5)
28
28
  rack-mount (~> 0.6.14)
29
29
  rack-test (~> 0.5.7)
30
30
  tzinfo (~> 0.3.23)
31
- activemodel (3.0.9)
32
- activesupport (= 3.0.9)
31
+ activemodel (3.0.12)
32
+ activesupport (= 3.0.12)
33
33
  builder (~> 2.1.2)
34
34
  i18n (~> 0.5.0)
35
- activerecord (3.0.9)
36
- activemodel (= 3.0.9)
37
- activesupport (= 3.0.9)
35
+ activerecord (3.0.12)
36
+ activemodel (= 3.0.12)
37
+ activesupport (= 3.0.12)
38
38
  arel (~> 2.0.10)
39
39
  tzinfo (~> 0.3.23)
40
- activeresource (3.0.9)
41
- activemodel (= 3.0.9)
42
- activesupport (= 3.0.9)
43
- activesupport (3.0.9)
44
- addressable (2.2.6)
40
+ activeresource (3.0.12)
41
+ activemodel (= 3.0.12)
42
+ activesupport (= 3.0.12)
43
+ activesupport (3.0.12)
44
+ addressable (2.2.7)
45
45
  appraisal (0.3.8)
46
46
  bundler
47
47
  rake
48
48
  arel (2.0.10)
49
- aruba (0.4.6)
50
- bcat (>= 0.6.1)
51
- childprocess (>= 0.2.0)
52
- cucumber (>= 1.0.2)
53
- rdiscount (>= 1.6.8)
54
- rspec (>= 2.6.0)
55
- bcat (0.6.2)
56
- rack (~> 1.0)
57
- bourne (1.0)
58
- mocha (= 0.9.8)
49
+ aruba (0.4.11)
50
+ childprocess (>= 0.2.3)
51
+ cucumber (>= 1.1.1)
52
+ ffi (>= 1.0.11)
53
+ rspec (>= 2.7.0)
54
+ bourne (1.1.2)
55
+ mocha (= 0.10.5)
59
56
  builder (2.1.2)
60
57
  capybara (1.1.2)
61
58
  mime-types (>= 1.16)
@@ -64,88 +61,88 @@ GEM
64
61
  rack-test (>= 0.5.4)
65
62
  selenium-webdriver (~> 2.0)
66
63
  xpath (~> 0.1.4)
67
- childprocess (0.3.0)
64
+ childprocess (0.3.1)
68
65
  ffi (~> 1.0.6)
69
- cucumber (1.1.4)
66
+ cucumber (1.1.9)
70
67
  builder (>= 2.1.2)
71
68
  diff-lcs (>= 1.1.2)
72
- gherkin (~> 2.7.1)
69
+ gherkin (~> 2.9.0)
73
70
  json (>= 1.4.6)
74
71
  term-ansicolor (>= 1.0.6)
75
72
  cucumber-rails (1.1.1)
76
73
  capybara (>= 1.1.1)
77
74
  cucumber (>= 1.1.0)
78
75
  nokogiri (>= 1.5.0)
79
- database_cleaner (0.7.1)
76
+ database_cleaner (0.7.2)
80
77
  diesel (0.1.5)
81
78
  railties
82
79
  diff-lcs (1.1.3)
83
80
  erubis (2.6.6)
84
81
  abstract (>= 1.0.0)
85
- factory_girl (2.5.0)
86
- activesupport
87
- factory_girl_rails (1.6.0)
88
- factory_girl (~> 2.5.0)
82
+ factory_girl (2.6.4)
83
+ activesupport (>= 2.3.9)
84
+ factory_girl_rails (1.7.0)
85
+ factory_girl (~> 2.6.0)
89
86
  railties (>= 3.0.0)
90
87
  ffi (1.0.11)
91
- gherkin (2.7.6)
88
+ gherkin (2.9.3)
92
89
  json (>= 1.4.6)
93
90
  i18n (0.5.0)
94
- json (1.6.5)
95
- launchy (2.0.5)
91
+ json (1.6.6)
92
+ launchy (2.1.0)
96
93
  addressable (~> 2.2.6)
97
94
  mail (2.2.19)
98
95
  activesupport (>= 2.3.6)
99
96
  i18n (>= 0.4.0)
100
97
  mime-types (~> 1.16)
101
98
  treetop (~> 1.4.8)
102
- mime-types (1.17.2)
103
- mocha (0.9.8)
104
- rake
105
- multi_json (1.0.4)
106
- nokogiri (1.5.0)
99
+ metaclass (0.0.1)
100
+ mime-types (1.18)
101
+ mocha (0.10.5)
102
+ metaclass (~> 0.0.1)
103
+ multi_json (1.2.0)
104
+ nokogiri (1.5.2)
107
105
  polyglot (0.3.3)
108
106
  rack (1.2.5)
109
107
  rack-mount (0.6.14)
110
108
  rack (>= 1.0.0)
111
109
  rack-test (0.5.7)
112
110
  rack (>= 1.0)
113
- rails (3.0.9)
114
- actionmailer (= 3.0.9)
115
- actionpack (= 3.0.9)
116
- activerecord (= 3.0.9)
117
- activeresource (= 3.0.9)
118
- activesupport (= 3.0.9)
111
+ rails (3.0.12)
112
+ actionmailer (= 3.0.12)
113
+ actionpack (= 3.0.12)
114
+ activerecord (= 3.0.12)
115
+ activeresource (= 3.0.12)
116
+ activesupport (= 3.0.12)
119
117
  bundler (~> 1.0)
120
- railties (= 3.0.9)
121
- railties (3.0.9)
122
- actionpack (= 3.0.9)
123
- activesupport (= 3.0.9)
118
+ railties (= 3.0.12)
119
+ railties (3.0.12)
120
+ actionpack (= 3.0.12)
121
+ activesupport (= 3.0.12)
124
122
  rake (>= 0.8.7)
125
123
  rdoc (~> 3.4)
126
124
  thor (~> 0.14.4)
127
125
  rake (0.9.2.2)
128
- rdiscount (1.6.8)
129
126
  rdoc (3.12)
130
127
  json (~> 1.4)
131
- rspec (2.6.0)
132
- rspec-core (~> 2.6.0)
133
- rspec-expectations (~> 2.6.0)
134
- rspec-mocks (~> 2.6.0)
135
- rspec-core (2.6.4)
136
- rspec-expectations (2.6.0)
137
- diff-lcs (~> 1.1.2)
138
- rspec-mocks (2.6.0)
139
- rspec-rails (2.6.1)
140
- actionpack (~> 3.0)
141
- activesupport (~> 3.0)
142
- railties (~> 3.0)
143
- rspec (~> 2.6.0)
144
- rubyzip (0.9.5)
145
- selenium-webdriver (2.18.0)
128
+ rspec (2.9.0)
129
+ rspec-core (~> 2.9.0)
130
+ rspec-expectations (~> 2.9.0)
131
+ rspec-mocks (~> 2.9.0)
132
+ rspec-core (2.9.0)
133
+ rspec-expectations (2.9.1)
134
+ diff-lcs (~> 1.1.3)
135
+ rspec-mocks (2.9.0)
136
+ rspec-rails (2.9.0)
137
+ actionpack (>= 3.0)
138
+ activesupport (>= 3.0)
139
+ railties (>= 3.0)
140
+ rspec (~> 2.9.0)
141
+ rubyzip (0.9.6.1)
142
+ selenium-webdriver (2.20.0)
146
143
  childprocess (>= 0.2.5)
147
- ffi (~> 1.0.9)
148
- multi_json (~> 1.0.4)
144
+ ffi (~> 1.0)
145
+ multi_json (~> 1.0)
149
146
  rubyzip
150
147
  sqlite3 (1.3.5)
151
148
  term-ansicolor (1.0.7)
@@ -154,7 +151,7 @@ GEM
154
151
  treetop (1.4.10)
155
152
  polyglot
156
153
  polyglot (>= 0.3.1)
157
- tzinfo (0.3.31)
154
+ tzinfo (0.3.32)
158
155
  xpath (0.1.4)
159
156
  nokogiri (~> 1.3)
160
157
 
@@ -165,15 +162,15 @@ DEPENDENCIES
165
162
  appraisal (~> 0.3.8)
166
163
  aruba (~> 0.4.2)
167
164
  bourne
168
- bundler (~> 1.0.0)
165
+ bundler (~> 1.1.0)
169
166
  capybara (~> 1.1.1)
170
167
  clearance!
171
168
  cucumber-rails (~> 1.1.1)
172
169
  database_cleaner
173
- factory_girl_rails
170
+ factory_girl_rails (= 1.7.0)
174
171
  launchy
175
- rails (= 3.0.9)
176
- rspec-rails (~> 2.6.0)
172
+ rails (= 3.0.12)
173
+ rspec-rails (~> 2.9.0)
177
174
  shoulda-matchers!
178
175
  sqlite3
179
176
  timecop