Commit ce36171d62852719508d450b126fd53516c16988
Exists in
master
and in
1 other branch
Merge pull request #923 from steveyken/master
Fixed notice parsing error when request['url'] is 'file:///...'
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
app/models/notice.rb
spec/models/notice_spec.rb
| ... | ... | @@ -89,6 +89,11 @@ describe Notice, type: 'model' do |
| 89 | 89 | end |
| 90 | 90 | |
| 91 | 91 | it "returns 'N/A' when url is not valid" do |
| 92 | + notice = Fabricate.build(:notice, :request => {'url' => "file:///path/to/some/resource/12"}) | |
| 93 | + expect(notice.host).to eq 'N/A' | |
| 94 | + end | |
| 95 | + | |
| 96 | + it "returns 'N/A' when url is not valid" do | |
| 92 | 97 | notice = Fabricate.build(:notice, :request => {'url' => "some string"}) |
| 93 | 98 | expect(notice.host).to eq 'N/A' |
| 94 | 99 | end | ... | ... |