diff --git a/lib/generators/cypress_on_rails/templates/spec/playwright/support/on-rails.js b/lib/generators/cypress_on_rails/templates/spec/playwright/support/on-rails.js index 76f3bed..d528012 100644 --- a/lib/generators/cypress_on_rails/templates/spec/playwright/support/on-rails.js +++ b/lib/generators/cypress_on_rails/templates/spec/playwright/support/on-rails.js @@ -8,7 +8,7 @@ const appCommands = async (data) => { const response = await context.post('/__e2e__/command', { data }) expect(response.ok()).toBeTruthy() - return response.body + return response.json(); } const app = (name, options = {}) => appCommands({ name, options }).then((body) => body[0]) @@ -23,7 +23,7 @@ const appVcrInsertCassette = async (cassette_name, options) => { Object.keys(options).forEach(key => options[key] === undefined ? delete options[key] : {}); const response = await context.post("/__e2e__/vcr/insert", {data: [cassette_name,options]}); expect(response.ok()).toBeTruthy(); - return response.body; + return response.json(); } const appVcrEjectCassette = async () => { @@ -31,7 +31,7 @@ const appVcrEjectCassette = async () => { const response = await context.post("/__e2e__/vcr/eject"); expect(response.ok()).toBeTruthy(); - return response.body; + return response.json(); } export { appCommands, app, appScenario, appEval, appFactories, appVcrInsertCassette, appVcrEjectCassette } diff --git a/specs_e2e/rails_4_2/Gemfile b/specs_e2e/rails_4_2/Gemfile index 835f8b5..3ca9472 100644 --- a/specs_e2e/rails_4_2/Gemfile +++ b/specs_e2e/rails_4_2/Gemfile @@ -3,6 +3,9 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 4.2.10' gem 'sprockets', '~> 3.7.2' +# Solution for issue: NoMethodError: undefined method `new' for BigDecimal:Class +# https://github.com/ruby/bigdecimal?tab=readme-ov-file#which-version-should-you-select +gem 'bigdecimal', '1.3.5' group :development, :test do gem 'vcr'