Skip to content
This repository has been archived by the owner on Jul 22, 2019. It is now read-only.

Commit

Permalink
Upgrade to devise 4.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
levent committed Oct 8, 2016
1 parent 88347a7 commit 29d99d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ def ensure_domain
end

def configure_permitted_parameters
devise_parameter_sanitizer.for(:sign_up) << :name
devise_parameter_sanitizer.permit(:sign_up, keys: [:name])
end
end
7 changes: 6 additions & 1 deletion spec/models/person_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@
@it = Person.new
end

it { should validate_uniqueness_of :email }
it { should validate_presence_of :name }
it { should validate_presence_of :email }
it { should have_many :projects }
it { should have_many :user_stories }

it "should validate_uniqueness_of :email" do
p1 = create_person
p2 = Person.new(email: p1.email).tap(&:valid?)
expect(p2.errors[:email]).to include('has already been taken')
end

describe 'admin?' do
let(:user) { Person.new }

Expand Down
2 changes: 1 addition & 1 deletion spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
# https://relishapp.com/rspec/rspec-rails/docs
Capybara.default_host = "http://app.agileista.local"
config.infer_spec_type_from_file_location!
config.include Devise::TestHelpers, type: :controller
config.include Devise::Test::ControllerHelpers, type: :controller
config.include SpecHelpers::ModelsHelper
config.include Warden::Test::Helpers
Warden.test_mode!
Expand Down

0 comments on commit 29d99d9

Please sign in to comment.