Commit 2e37587 1 parent 97bf933 commit 2e37587 Copy full SHA for 2e37587
File tree 4 files changed +12
-12
lines changed
app/models/feedback_reporters
spec/models/feedback_reporters
4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def custom_zoho_fields
16
16
# To avoid issues where Zoho ticket creation silently fails, only grab the first
17
17
# 2080 characters of the referer URL. That may miss some complex search queries,
18
18
# but still keep enough to be useful most of the time.
19
- truncated_referer = url . present? ? url [ 0 ..2079 ] : ""
19
+ truncated_referer = referer . present? ? referer [ 0 ..2079 ] : ""
20
20
{
21
21
"cf_archive_version" => site_revision . presence || "Unknown site revision" ,
22
22
"cf_rollout" => rollout . presence || "Unknown" ,
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ Feature: Filing a support request
61
61
And the email should not contain "<img src=" http://www.example.org/foo.jpg" />"
62
62
But the email should contain "http://www.example.org/foo.jpgHi"
63
63
64
- Scenario : Submit a request with an on-Archive referer URL
64
+ Scenario : Submit a request with an on-Archive referer
65
65
66
66
Given I am logged in as "puzzled"
67
67
And basic languages
@@ -72,9 +72,9 @@ Feature: Filing a support request
72
72
And I fill in "Brief summary" with "Just a brief note"
73
73
And I fill in "Your question or problem" with "Hi, I came from the Archive"
74
74
And I press "Send"
75
- Then a Zoho ticket should be created with url "http://www.example.com/works"
75
+ Then a Zoho ticket should be created with referer "http://www.example.com/works"
76
76
77
- Scenario : Submit a request with a referer URL that is not on-Archive
77
+ Scenario : Submit a request with a referer that is not on-Archive
78
78
79
79
Given I am logged in as "puzzled"
80
80
And basic languages
@@ -84,4 +84,4 @@ Feature: Filing a support request
84
84
And I fill in "Brief summary" with "Just a brief note"
85
85
And I fill in "Your question or problem" with "Hi, I didn't come from the Archive"
86
86
And I press "Send"
87
- Then a Zoho ticket should be created with url ""
87
+ Then a Zoho ticket should be created with referer ""
Original file line number Diff line number Diff line change 12
12
allow ( ArchiveConfig ) . to receive ( :PERMITTED_HOSTS ) . and_return ( [ host ] )
13
13
end
14
14
15
- Then "a Zoho ticket should be created with url {string}" do |url |
15
+ Then "a Zoho ticket should be created with referer {string}" do |referer |
16
16
# rubocop:disable Lint/AmbiguousBlockAssociation
17
17
expect ( WebMock ) . to have_requested ( :post , "https://desk.zoho.com/api/v1/tickets" )
18
- . with { |req | JSON . parse ( req . body ) [ "cf" ] [ "cf_ticket_url" ] == url }
18
+ . with { |req | JSON . parse ( req . body ) [ "cf" ] [ "cf_ticket_url" ] == referer }
19
19
# rubocop:enable Lint/AmbiguousBlockAssociation
20
20
end
Original file line number Diff line number Diff line change 16
16
site_revision : "eternal_beta" ,
17
17
rollout : "rollout_value" ,
18
18
ip_address : "127.0.0.1" ,
19
- url : "https://example.com/works/1" ,
19
+ referer : "https://example.com/works/1" ,
20
20
site_skin : build ( :skin , title : "Reversi" , public : true )
21
21
}
22
22
end
116
116
117
117
context "if the report has an empty URL" do
118
118
before do
119
- allow ( subject ) . to receive ( :url ) . and_return ( "" )
119
+ allow ( subject ) . to receive ( :referer ) . and_return ( "" )
120
120
end
121
121
122
- it "returns a hash containing a blank string for URL " do
122
+ it "returns a hash containing a blank string for referer " do
123
123
expect ( subject . report_attributes . dig ( "cf" , "cf_ticket_url" ) ) . to eq ( "" )
124
124
end
125
125
end
126
126
127
- context "if the reporter has a very long URL" do
127
+ context "if the reporter has a very long referer URL" do
128
128
before do
129
- allow ( subject ) . to receive ( :url ) . and_return ( "a" * 2081 )
129
+ allow ( subject ) . to receive ( :referer ) . and_return ( "a" * 2081 )
130
130
end
131
131
132
132
it "truncates the URL to 2080 characters" do
You can’t perform that action at this time.
0 commit comments