Permalink
Browse files

Clearance cannot be added to an existing app

Since the generated migration adds non-NULL requirements to columns, and
since we never add Clearance to existing apps, we cannot trivially test
the nuances involved in that situation. For now, we do not support this.
  • Loading branch information...
1 parent 2900d73 commit 3243fe81d3d0d15ef80ca714b37d0a421a590dde @mike-burns mike-burns committed Jul 23, 2012
Showing with 7 additions and 23 deletions.
  1. +4 −4 db/schema.rb
  2. +1 −1 gemfiles/3.0.15.gemfile.lock
  3. +1 −1 gemfiles/3.1.6.gemfile.lock
  4. +1 −1 gemfiles/3.2.6.gemfile.lock
  5. +0 −16 spec/models/user_spec.rb
View
8 db/schema.rb
@@ -14,12 +14,12 @@
ActiveRecord::Schema.define(:version => 20110111224543) do
create_table "users", :force => true do |t|
- t.string "email"
- t.string "encrypted_password", :limit => 128
- t.string "confirmation_token", :limit => 128
- t.string "remember_token", :limit => 128
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
+ t.string "email", :null => false
+ t.string "encrypted_password", :limit => 128, :null => false
+ t.string "confirmation_token", :limit => 128
+ t.string "remember_token", :limit => 128, :null => false
end
add_index "users", ["email"], :name => "index_users_on_email"
View
2 gemfiles/3.0.15.gemfile.lock
@@ -1,5 +1,5 @@
PATH
- remote: /Users/croaky/dev/clearance
+ remote: /home/mike/thoughtbot/clearance
specs:
clearance (0.16.2)
bcrypt-ruby
View
2 gemfiles/3.1.6.gemfile.lock
@@ -1,5 +1,5 @@
PATH
- remote: /Users/croaky/dev/clearance
+ remote: /home/mike/thoughtbot/clearance
specs:
clearance (0.16.2)
bcrypt-ruby
View
2 gemfiles/3.2.6.gemfile.lock
@@ -1,5 +1,5 @@
PATH
- remote: /Users/croaky/dev/clearance
+ remote: /home/mike/thoughtbot/clearance
specs:
clearance (0.16.2)
bcrypt-ruby
View
16 spec/models/user_spec.rb
@@ -175,22 +175,6 @@ def password_optional?
end
end
- describe 'when user exists before Clearance was installed' do
- before do
- @user = create(:user)
- sql = "update users set encrypted_password = NULL, remember_token = NULL where id = #{@user.id}"
- ActiveRecord::Base.connection.update(sql)
- @user.reload.encrypted_password.should be_nil
- @user.reload.remember_token.should be_nil
- end
-
- it 'generates remember token and save encrypted password on update_password' do
- @user.update_password('password')
- @user.encrypted_password.should_not be_nil
- @user.remember_token.should_not be_nil
- end
- end
-
describe 'the password setter on a User' do
let(:password) { 'a-password' }
before { subject.send(:password=, password) }

0 comments on commit 3243fe8

Please sign in to comment.