Skip to content

Commit

Permalink
Merge pull request #3006 from tvdeyen/fix-builds
Browse files Browse the repository at this point in the history
[CI] Fix builds
  • Loading branch information
tvdeyen authored Sep 3, 2024
2 parents 49f1c47 + c0c1332 commit 86cdac7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion app/assets/builds/alchemy/admin.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions spec/libraries/page_layout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module Alchemy
context "with a YAML file including a symbol" do
let(:yaml) { "name: :symbol" }
before do
expect(File).to receive(:exist?).and_return(true)
expect(File).to receive(:read).and_return(yaml)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read).and_return(yaml)
end

it "returns the definition without error" do
Expand Down
12 changes: 6 additions & 6 deletions spec/models/alchemy/element_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ module Alchemy
let(:yaml) { "- name: :symbol" }

before do
expect(File).to receive(:exist?).and_return(true)
expect(File).to receive(:read).and_return(yaml)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read).and_return(yaml)
end

it "returns the definition without error" do
Expand All @@ -246,8 +246,8 @@ module Alchemy
let(:yaml) { "- default: 2017-12-24" }

before do
expect(File).to receive(:exist?).and_return(true)
expect(File).to receive(:read).and_return(yaml)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read).and_return(yaml)
end

it "returns the definition without error" do
Expand All @@ -259,8 +259,8 @@ module Alchemy
let(:yaml) { "- format: !ruby/regexp '/\A[^@\s]+@([^@\s]+.)+[^@\s]+\z/'" }

before do
expect(File).to receive(:exist?).and_return(true)
expect(File).to receive(:read).and_return(yaml)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read).and_return(yaml)
end

it "returns the definition without error" do
Expand Down
19 changes: 5 additions & 14 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,6 @@
FactoryBot.definition_file_paths.append(Alchemy::TestSupport.factories_path)
FactoryBot.find_definitions

Capybara.register_driver :selenium_chrome_headless do |app|
Capybara::Selenium::Driver.load_selenium
browser_options = ::Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.args << "--headless"
opts.args << "--disable-gpu" if Gem.win_platform?
# Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary
opts.args << "--disable-site-isolation-trials"
opts.args << "--window-size=1280,800"
end
Capybara::Selenium::Driver.new(app, browser: :chrome, options: browser_options)
end

Shoulda::Matchers.configure do |config|
config.integrate do |with|
with.test_framework :rspec
Expand Down Expand Up @@ -108,7 +96,10 @@
end
end

config.before(:each, type: :system, js: true) do
driven_by :selenium_chrome_headless
config.before(:each, type: :system, js: true) do |example|
screen_size = example.metadata[:screen_size] || [1280, 800]
driven_by(:selenium, using: :headless_chrome, screen_size: screen_size) do |capabilities|
capabilities.add_argument("--disable-search-engine-choice-screen")
end
end
end

0 comments on commit 86cdac7

Please sign in to comment.