Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[#206] Improve data integrity

By default, we want email, encrypted_password, and remember_token to
enforce a NOT NULL constraint.
  • Loading branch information...
commit fd6fbc067b93825cfb9243a208395312aa6c1fca 1 parent 564b859
@croaky croaky authored
View
18 db/migrate/20110111224543_create_clearance_users.rb
@@ -0,0 +1,18 @@
+class CreateClearanceUsers < ActiveRecord::Migration
+ def self.up
+ create_table :users do |t|
+ t.timestamps :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
+ add_index :users, :remember_token
+ end
+
+ def self.down
+ drop_table :users
+ end
+end
View
18 db/migrate/20110111224543_create_diesel_clearance_users.rb
@@ -1,18 +0,0 @@
-class CreateDieselClearanceUsers < ActiveRecord::Migration
- def self.up
- create_table(:users) do |t|
- t.string :email
- t.string :encrypted_password, :limit => 128
- t.string :confirmation_token, :limit => 128
- t.string :remember_token, :limit => 128
- t.timestamps
- end
-
- add_index :users, :email
- add_index :users, :remember_token
- end
-
- def self.down
- drop_table :users
- end
-end
View
7 features/engine/visitor_resets_password.feature
@@ -32,10 +32,3 @@ Feature: Password reset
When I sign in with "email@example.com" and "newpassword"
Then I should be signed in
- Scenario: User who was created before Clearance was installed creates password for first time
- Given a user "email@example.com" exists without a remember token or password
- When I reset the password for "email@example.com"
- When I follow the password reset link sent to "email@example.com"
- And I update my password with "newpassword"
- Then I should be signed in
-
View
6 features/step_definitions/engine/clearance_steps.rb
@@ -6,12 +6,6 @@
FactoryGirl.create :user, :email => email
end
-Given /^a user "([^"]*)" exists without a remember token or password$/ do |email|
- user = FactoryGirl.create(:user, :email => email)
- sql = "update users set encrypted_password = NULL, remember_token = NULL where id = #{user.id}"
- ActiveRecord::Base.connection.update sql
-end
-
# Sign up
When /^I sign up (?:with|as) "(.*)" and "(.*)"$/ do |email, password|
Please sign in to comment.
Something went wrong with that request. Please try again.