Skip to content

Commit fd5a631

Browse files
authored
Support rails 7.1 by adding content-type header to generated on-rails.js file (#148)
1 parent bce4b18 commit fd5a631

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
### Fixed
77
* fix update index.js in install generatpr [PR 147](https://github.com/shakacode/cypress-on-rails/pull/147) by [Judahmeek]
8+
* Support rails 7.1 by adding content-type header to generated on-rails.js file [PR 148](https://github.com/shakacode/cypress-on-rails/pull/148) by [anark]
89

910
## [1.16.0]
1011
[Compare]: https://github.com/shakacode/cypress-on-rails/compare/v1.15.1...v1.16.0

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ Cypress.Commands.add('appCommands', function (body) {
66
method: 'POST',
77
url: "/__e2e__/command",
88
body: JSON.stringify(body),
9+
headers: {
10+
'Content-Type': 'application/json',
11+
},
912
log: false,
1013
failOnStatusCode: false
1114
}).then((response) => {
@@ -52,6 +55,9 @@ Cypress.on('fail', (err, runnable) => {
5255
Cypress.$.ajax({
5356
url: '/__e2e__/command',
5457
data: JSON.stringify({name: 'log_fail', options: {error_message: err.message, runnable_full_title: runnable.fullTitle() }}),
58+
headers: {
59+
'Content-Type': 'application/json',
60+
},
5561
async: false,
5662
method: 'POST'
5763
});

0 commit comments

Comments
 (0)