Commit 419a95d

mo <mo.khan@gmail.com>
2018-04-09 21:08:27
add system test to log in.
1 parent 30202d6
Changed files (1)
spec/system/direct_login_spec.rb
@@ -0,0 +1,14 @@
+require 'rails_helper'
+
+describe "when logging in directly in to the application", js: true do
+  let(:user) { create(:user) }
+
+  it 'redirects the user to the dashboard' do
+    visit root_path
+    fill_in "user_email", with: user.email
+    fill_in "user_password", with: user.password
+    click_button I18n.t('sessions.new.login')
+
+    expect(page).to have_content('Dashboard')
+  end
+end