Skip to content
This repository
Browse code

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...
commit 3243fe81d3d0d15ef80ca714b37d0a421a590dde 1 parent 2900d73
Mike Burns authored July 23, 2012
8  db/schema.rb
@@ -14,12 +14,12 @@
14 14
 ActiveRecord::Schema.define(:version => 20110111224543) do
15 15
 
16 16
   create_table "users", :force => true do |t|
17  
-    t.string   "email"
18  
-    t.string   "encrypted_password", :limit => 128
19  
-    t.string   "confirmation_token", :limit => 128
20  
-    t.string   "remember_token",     :limit => 128
21 17
     t.datetime "created_at",                        :null => false
22 18
     t.datetime "updated_at",                        :null => false
  19
+    t.string   "email",                             :null => false
  20
+    t.string   "encrypted_password", :limit => 128, :null => false
  21
+    t.string   "confirmation_token", :limit => 128
  22
+    t.string   "remember_token",     :limit => 128, :null => false
23 23
   end
24 24
 
25 25
   add_index "users", ["email"], :name => "index_users_on_email"
2  gemfiles/3.0.15.gemfile.lock
... ...
@@ -1,5 +1,5 @@
1 1
 PATH
2  
-  remote: /Users/croaky/dev/clearance
  2
+  remote: /home/mike/thoughtbot/clearance
3 3
   specs:
4 4
     clearance (0.16.2)
5 5
       bcrypt-ruby
2  gemfiles/3.1.6.gemfile.lock
... ...
@@ -1,5 +1,5 @@
1 1
 PATH
2  
-  remote: /Users/croaky/dev/clearance
  2
+  remote: /home/mike/thoughtbot/clearance
3 3
   specs:
4 4
     clearance (0.16.2)
5 5
       bcrypt-ruby
2  gemfiles/3.2.6.gemfile.lock
... ...
@@ -1,5 +1,5 @@
1 1
 PATH
2  
-  remote: /Users/croaky/dev/clearance
  2
+  remote: /home/mike/thoughtbot/clearance
3 3
   specs:
4 4
     clearance (0.16.2)
5 5
       bcrypt-ruby
16  spec/models/user_spec.rb
@@ -175,22 +175,6 @@ def password_optional?
175 175
     end
176 176
   end
177 177
 
178  
-  describe 'when user exists before Clearance was installed' do
179  
-    before do
180  
-      @user = create(:user)
181  
-      sql  = "update users set encrypted_password = NULL, remember_token = NULL where id = #{@user.id}"
182  
-      ActiveRecord::Base.connection.update(sql)
183  
-      @user.reload.encrypted_password.should be_nil
184  
-      @user.reload.remember_token.should be_nil
185  
-    end
186  
-
187  
-    it 'generates remember token and save encrypted password on update_password' do
188  
-      @user.update_password('password')
189  
-      @user.encrypted_password.should_not be_nil
190  
-      @user.remember_token.should_not be_nil
191  
-    end
192  
-  end
193  
-
194 178
   describe 'the password setter on a User' do
195 179
     let(:password) { 'a-password' }
196 180
     before { subject.send(:password=, password) }

0 notes on commit 3243fe8

Please sign in to comment.
Something went wrong with that request. Please try again.