Skip to content

Commit 3676725

Browse files
committed
Copy in code from shakacode#168
1 parent 4c7832c commit 3676725

File tree

2 files changed

+6
-3
lines changed
  • lib/generators/cypress_on_rails/templates/spec/playwright/support
  • specs_e2e/rails_4_2

2 files changed

+6
-3
lines changed

lib/generators/cypress_on_rails/templates/spec/playwright/support/on-rails.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const appCommands = async (data) => {
88
const response = await context.post('/__e2e__/command', { data })
99

1010
expect(response.ok()).toBeTruthy()
11-
return response.body
11+
return response.json()
1212
}
1313

1414
const app = (name, options = {}) => appCommands({ name, options }).then((body) => body[0])
@@ -23,15 +23,15 @@ const appVcrInsertCassette = async (cassette_name, options) => {
2323
Object.keys(options).forEach(key => options[key] === undefined ? delete options[key] : {});
2424
const response = await context.post("/__e2e__/vcr/insert", {data: [cassette_name,options]});
2525
expect(response.ok()).toBeTruthy();
26-
return response.body;
26+
return response.json();
2727
}
2828

2929
const appVcrEjectCassette = async () => {
3030
const context = await contextPromise;
3131

3232
const response = await context.post("/__e2e__/vcr/eject");
3333
expect(response.ok()).toBeTruthy();
34-
return response.body;
34+
return response.json();
3535
}
3636

3737
export { appCommands, app, appScenario, appEval, appFactories, appVcrInsertCassette, appVcrEjectCassette }

specs_e2e/rails_4_2/Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ source 'https://rubygems.org'
33
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
44
gem 'rails', '~> 4.2.10'
55
gem 'sprockets', '~> 3.7.2'
6+
# Solution for issue: NoMethodError: undefined method `new' for BigDecimal:Class
7+
# https://github.com/ruby/bigdecimal?tab=readme-ov-file#which-version-should-you-select
8+
gem 'bigdecimal', '1.3.5'
69

710
group :development, :test do
811
gem 'vcr'

0 commit comments

Comments
 (0)