Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
with:
node-version: '16.6.0'
cache: 'yarn'
node-version: 16

# Copy all of the example configs over
- name: 'Setup the application'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:
with:
node-version: '16.6.0'
cache: 'yarn'
node-version: 16

# Install the Postgres developer packages
- name: 'Install Postgresql Packages'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ group :test do
gem 'capybara'

# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
gem 'selenium-webdriver'

# RSpec::CollectionMatchers lets you express expected outcomes on
# collections of an object in an example.
Expand Down
9 changes: 3 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ GEM
sawyer (0.9.2)
addressable (>= 2.3.5)
faraday (>= 0.17.3, < 3)
selenium-webdriver (4.10.0)
selenium-webdriver (4.16.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
Expand Down Expand Up @@ -517,10 +517,6 @@ GEM
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (5.3.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0, < 4.11)
webmock (3.19.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand All @@ -542,6 +538,7 @@ GEM

PLATFORMS
arm64-darwin-21
arm64-darwin-22
x86_64-linux

DEPENDENCIES
Expand Down Expand Up @@ -605,6 +602,7 @@ DEPENDENCIES
rubocop
rubocop-i18n
rubocop-performance
selenium-webdriver
shoulda
spring
spring-commands-rspec
Expand All @@ -613,7 +611,6 @@ DEPENDENCIES
translation
turbo-rails
web-console
webdrivers
webmock
wicked_pdf
wkhtmltopdf-binary
Expand Down
3 changes: 2 additions & 1 deletion config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@

# Throttle attempts to a particular path. 4 POSTs to /users/sign_in every 30 seconds
Rack::Attack.throttle "logins/ip", limit: 4, period: 30.seconds do |req|
req.post? && req.path == "/users/sign_in" && req.ip
# Don't apply sign-in rate-limiting to test environment
req.post? && req.path == "/users/sign_in" && req.ip unless Rails.env.test?
end
2 changes: 1 addition & 1 deletion spec/factories/orgs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
region { Region.first || create(:region) }
language { Language.default }
is_other { false }
contact_email { Faker::Internet.safe_email }
contact_email { Faker::Internet.email }
contact_name { Faker::Name.name }
managed { true }
trait :institution do
Expand Down
2 changes: 1 addition & 1 deletion spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
language { Language.default }
firstname { Faker::Name.unique.first_name }
surname { Faker::Name.unique.last_name }
email { Faker::Internet.unique.safe_email }
email { Faker::Internet.unique.email }
password { 'password' }
accept_terms { true }

Expand Down
2 changes: 1 addition & 1 deletion spec/features/annotations/annotations_editing_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
expect { click_button 'Save' }.not_to change { Annotation.count }
end
expect(annotation.text).to eql('Foo bar')
expect(Annotation.order('created_at').last.text).to eql('Noo bar')
expect(Annotation.order('created_at').last.text).to eql('<p>Noo bar</p>')
expect(page).not_to have_errors
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/templates/templates_editings_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
click_button 'Save'
end
# Make sure annotation has been updated
expect(Question.find(template.question_ids.first).annotations.first.text).to eql('Foo bar')
expect(Question.find(template.question_ids.first).annotations.first.text).to eql('<p>Foo bar</p>')
# Make sure blank records are not created for empty annotation form
expect(Question.find(template.question_ids.first).annotations.count).to eql(1)
expect(page).not_to have_errors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
end
expect(page).to have_css('#new_question_new_question')
within('#new_question_new_question') do
expect(find('#new_question_question_text')).to be_present
fill_in :new_question_question_text, with: 'Text for this specific question'
tinymce_fill_in :new_question_question_text, with: 'Text for this specific question'
expect { click_button('Save') }.to change { Question.count }.by(1)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/plan_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@

context 'when org contact_email present' do
before do
org.update!(contact_email: Faker::Internet.safe_email)
org.update!(contact_email: Faker::Internet.email)
end

it 'emails the admins' do
Expand Down
6 changes: 2 additions & 4 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@
# No need to run this during CI because we build the DB from the schema
# ActiveRecord::Migration.maintain_test_schema!

# Block all external HTTP requests except to the Google APIs URL so that WebDrivers can fetch
# the latest Chromedrivers.
# Block all external HTTP requests
WebMock.disable_net_connect!(
allow_localhost: true,
allow: %w[chromedriver.storage.googleapis.com]
allow_localhost: true
)

# Configure RSpec
Expand Down
13 changes: 1 addition & 12 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,7 @@
end

# Enable Capybara webmocks if we are testing a feature
config.before(:each) do |example|
if example.metadata[:type] == :feature
# Capybara::Webmock.start

# Allow Capybara to make localhost requests and also contact the
# google api chromedriver store
# WebMock.disable_net_connect!(
# allow_localhost: true,
# allow: %w[chromedriver.storage.googleapis.com]
# )
end

config.before(:each) do
# Ensure that there is always a default Language
create(:language, abbreviation: 'en', default_language: true) unless Language.default.present?
end
Expand Down
5 changes: 0 additions & 5 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
# frozen_string_literal: true

require 'webdrivers/chromedriver'

# Cache for one hour
Webdrivers.cache_time = 3600

# Use Puma as the webserver for feature tests
Capybara.server = :puma, { Silent: true }

Expand Down