Installed gem faker for generate data in tests.
Created User factory for using in tests.
Write tests for sign up and sign in
diff --git a/Gemfile b/Gemfile
index 2899c05..2c069b6 100644
--- a/Gemfile
+++ b/Gemfile
@@ -52,6 +52,7 @@
   gem 'capybara-webkit'
   gem 'capybara-screenshot'
   gem 'headless'
+  gem 'faker'
 end
 
 group :test do
diff --git a/Gemfile.lock b/Gemfile.lock
index 5a38925..fba6fe9 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -86,6 +86,8 @@
     factory_girl_rails (4.5.0)
       factory_girl (~> 4.5.0)
       railties (>= 3.0.0)
+    faker (1.4.3)
+      i18n (~> 0.5)
     globalid (0.3.5)
       activesupport (>= 4.1.0)
     headless (2.1.0)
@@ -228,6 +230,7 @@
   database_rewinder
   devise
   factory_girl_rails
+  faker
   headless
   jbuilder (~> 2.0)
   jquery-rails
diff --git a/spec/factories/users.rb b/spec/factories/users.rb
new file mode 100644
index 0000000..3804565
--- /dev/null
+++ b/spec/factories/users.rb
@@ -0,0 +1,27 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+FactoryGirl.define do
+  factory :user do
+    email Faker::Internet.email
+    firstname Faker::Name.first_name
+    lastname Faker::Name.last_name
+    password Faker::Internet.password
+  end
+end
diff --git a/spec/feature/devise/registration_spec.rb b/spec/feature/devise/registration_spec.rb
new file mode 100644
index 0000000..c54c34a
--- /dev/null
+++ b/spec/feature/devise/registration_spec.rb
@@ -0,0 +1,75 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+RSpec.describe 'Registration' do
+  subject { page }
+
+  before do
+    visit new_user_registration_path
+  end
+
+  it 'correct' do
+    password = Faker::Internet.password
+    firstname = Faker::Name.first_name
+    fill_in 'user_email', with: Faker::Internet.email
+    fill_in 'user_password', with: password
+    fill_in 'user_password_confirmation', with: password
+    fill_in 'user_firstname', with: firstname
+    expect {
+      click_button 'sign_up'
+      expect(current_path).to eq root_path
+      expect(page).to have_content firstname
+    }.to change(User, :count).by(1)
+  end
+
+  it 'empty password confirmation' do
+    fill_in 'user_email', with: Faker::Internet.email
+    fill_in 'user_password', with: Faker::Internet.password
+    expect {
+      click_button 'sign_up'
+    }.not_to change(User, :count)
+  end
+
+  it 'incorrect password confirmation' do
+    fill_in 'user_email', with: Faker::Internet.email
+    fill_in 'user_password', with: Faker::Internet.password
+    fill_in 'user_password_confirmation', with: Faker::Internet.password
+    expect {
+      click_button 'sign_up'
+    }.not_to change(User, :count)
+  end
+
+  it 'empty password' do
+    fill_in 'user_email', with: Faker::Internet.email
+    fill_in 'user_password_confirmation', with: Faker::Internet.password
+    expect {
+      click_button 'sign_up'
+    }.not_to change(User, :count)
+  end
+
+  it 'empty email' do
+    fill_in 'user_password', with: Faker::Internet.password
+    fill_in 'user_password_confirmation', with: Faker::Internet.password
+    expect {
+      click_button 'sign_up'
+    }.not_to change(User, :count)
+  end
+end
diff --git a/spec/feature/devise/session_spec.rb b/spec/feature/devise/session_spec.rb
new file mode 100644
index 0000000..e244150
--- /dev/null
+++ b/spec/feature/devise/session_spec.rb
@@ -0,0 +1,61 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+require 'spec_helper'
+
+RSpec.describe 'Session' do
+  subject { page }
+
+  let(:user) { create :user }
+
+  context 'sign_in', type: :feature do
+    before do
+      visit new_user_session_path
+    end
+
+    it 'correct email and password' do
+      fill_in 'user_email', with: user.email
+      fill_in 'user_password', with: user.password
+      click_button 'sign_in'
+      expect(current_path).to eq(root_path)
+      expect(page).to have_content user.firstname
+    end
+
+    it 'incorrect email' do
+      fill_in 'user_password', with: user.password
+      click_button 'sign_in'
+      expect(current_path).to eq(new_user_session_path)
+    end
+
+    it 'incorrect password' do
+      fill_in 'user_email', with: user.email
+      fill_in 'user_password', with: '111'
+      click_button 'sign_in'
+      expect(current_path).to eq(new_user_session_path)
+    end
+  end
+
+  it 'sign out', type: :feature, js: true do
+    sign_in user
+    click_link 'open_user_dropdown'
+    click_link 'sign_out'
+    expect(current_path).to eq(root_path)
+    expect(page).not_to have_content user.firstname
+  end
+end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 6048708..9bc2b76 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -37,6 +37,8 @@
   "screen_#{example.full_description.gsub(' ', '-').gsub(/^.*\/spec\//, '')}"
 end
 
+Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }
+
 ActiveRecord::Migration.maintain_test_schema!
 
 RSpec.configure do |config|
diff --git a/spec/support/login_helpers.rb b/spec/support/login_helpers.rb
new file mode 100644
index 0000000..30d0779
--- /dev/null
+++ b/spec/support/login_helpers.rb
@@ -0,0 +1,25 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+def sign_in(user)
+  visit new_user_session_path
+  fill_in 'user_email', with: user.email
+  fill_in 'user_password', with: user.password
+  click_button 'sign_in'
+end