File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
lib/rspec_api_documentation Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ def get_data
40
40
end
41
41
42
42
def post_data
43
- "-d \" #{ data } \" "
43
+ escaped_data = data . to_s . gsub ( "'" , "\\ u0027" )
44
+ "-d '#{ escaped_data } '"
44
45
end
45
46
46
47
private
Original file line number Diff line number Diff line change 13
13
14
14
it { should =~ /^curl/ }
15
15
it { should =~ /http:\/ \/ example\. com\/ orders/ }
16
- it { should =~ /-d " order%5Bsize%5D=large&order%5Btype%5D=cart" / }
16
+ it { should =~ /-d ' order%5Bsize%5D=large&order%5Btype%5D=cart' / }
17
17
it { should =~ /-X POST/ }
18
18
it { should =~ /-H "Accept: application\/ json"/ }
19
19
it { should =~ /-H "X-Header: header"/ }
50
50
51
51
it { should =~ /^curl/ }
52
52
it { should =~ /http:\/ \/ example\. com\/ orders\/ 1/ }
53
- it { should =~ /-d " size=large" / }
53
+ it { should =~ /-d ' size=large' / }
54
54
it { should =~ /-X PUT/ }
55
55
it { should =~ /-H "Accept: application\/ json"/ }
56
56
it { should =~ /-H "X-Header: header"/ }
You can’t perform that action at this time.
0 commit comments