From 494f341cad950124ba4e92e2829bd3993a2d5720 Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Sat, 18 Apr 2020 08:02:26 +0300 Subject: [PATCH] Fix more specs --- spec/features/issues/issues_spec.rb | 2 +- spec/features/users/case_insensitive_login_spec.rb | 4 ++-- spec/features/users/stream_spec.rb | 3 +-- spec/spec_helper.rb | 1 + 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/features/issues/issues_spec.rb b/spec/features/issues/issues_spec.rb index a53be93..2c3cb91 100644 --- a/spec/features/issues/issues_spec.rb +++ b/spec/features/issues/issues_spec.rb @@ -1,7 +1,7 @@ require 'rails_helper' feature 'Issues' do - let!(:user) { create :user } + let!(:user) { create :user } scenario 'creation' do sign_in_as user diff --git a/spec/features/users/case_insensitive_login_spec.rb b/spec/features/users/case_insensitive_login_spec.rb index 0084a6f..6073b21 100755 --- a/spec/features/users/case_insensitive_login_spec.rb +++ b/spec/features/users/case_insensitive_login_spec.rb @@ -12,7 +12,7 @@ feature "Case insensitive login", js: :true do feature "when a user with mixed-case username signs in" do scenario "with a matching case allows the user to sign in" do fill_login_form(username) - click_button submit(:user, :login) + find('.login input').trigger('click') expect(page).to have_content(I18n.t("login_successful")) @@ -23,7 +23,7 @@ feature "Case insensitive login", js: :true do scenario "with a non-matching case allows the user to sign in" do fill_login_form("CASE_INSENSITIVE") - click_button submit(:user, :login) + find('.login input').trigger('click') expect(page).to have_content(I18n.t("login_successful")) diff --git a/spec/features/users/stream_spec.rb b/spec/features/users/stream_spec.rb index 506c04b..18733e1 100755 --- a/spec/features/users/stream_spec.rb +++ b/spec/features/users/stream_spec.rb @@ -8,8 +8,7 @@ feature "User Stream Information" do scenario "user updates their stream" do visit user_path(user) expect(page.html).to_not include("
Stream
") - fill_login_form(user, password) - click_button submit(:user, :login) + sign_in_as(user) visit edit_user_path(user) stream_url = "twitch.tv/gold_n" expect(page).to have_content("Stream") diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index eb586ea..608fb40 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -41,6 +41,7 @@ Capybara.register_driver :selenium_remote do |app| desired_capabilities: Selenium::WebDriver::Remote::Capabilities.chrome ) end +Capybara.default_max_wait_time = 8 #Capybara.javascript_driver = :selenium #Capybara.javascript_driver = :selenium_remote