-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
272e868
commit 6b982b5
Showing
11 changed files
with
150 additions
and
117 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
73.0.3683.68 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# frozen_string_literal: true | ||
|
||
FactoryBot.define do | ||
factory :user do | ||
sequence(:email) { |n| "test_user#{n}@mail.com" } | ||
password { "12345678"} | ||
password_confirmation { "12345678" } | ||
sequence (:email) { |n| "#{n}_#{FFaker::Internet.email}" } | ||
password { '12345678' } | ||
password_confirmation { '12345678' } | ||
created_at { Date.today } | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'selenium/webdriver' | ||
|
||
# The default 'chrome_headless' capybara driver lacks the 'no-sandbox' | ||
# option, and crashes when run inside the development container: | ||
Capybara.server = :puma, { Silent: true } | ||
|
||
Capybara.register_driver :chrome_headless do |app| | ||
client = Selenium::WebDriver::Remote::Http::Default.new | ||
client.read_timeout = 100 | ||
client.open_timeout = 100 | ||
|
||
chrome_options = %w[ | ||
headless disable-gpu no-sandbox disable-dev-shm-usage window-size=1400,1400 | ||
] | ||
chrome_binary = '/usr/bin/chromium' | ||
|
||
options = Selenium::WebDriver::Chrome::Options.new args: chrome_options, | ||
binary: chrome_binary | ||
|
||
Capybara::Selenium::Driver.new app, | ||
browser: :chrome, | ||
options: options, | ||
http_client: client | ||
end | ||
|
||
RSpec.configure do |config| | ||
# For "normal" system tests (i.e. no javascript UI, etc) use the :rack_test | ||
# driver: | ||
config.before :each, type: :system do | ||
driven_by :rack_test | ||
end | ||
|
||
# For system tests involving javascript use the :chrome_headless driver: | ||
config.before :each, type: :system, js: true do | ||
driven_by :chrome_headless | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# frozen_string_literal: true | ||
|
||
RSpec.feature 'Login', type: :system do | ||
context 'log in' do | ||
scenario 'should be succesful' do | ||
user = FactoryBot.create(:user) | ||
visit new_user_session_path | ||
within('form') do | ||
fill_in 'Email', with: user.email | ||
fill_in 'Password', with: '12345678' | ||
click_on('Log in') | ||
end | ||
expect(current_path).to eq root_path | ||
end | ||
|
||
scenario 'should fail' do | ||
user = FactoryBot.create(:user) | ||
visit new_user_session_path | ||
within('form') do | ||
fill_in 'Email', with: user.email | ||
fill_in 'Password', with: '12345679' | ||
click_on('Log in') | ||
end | ||
expect(page).to have_content('Log in') | ||
end | ||
end | ||
end |